【发布时间】:2013-06-23 11:11:23
【问题描述】:
在 Delphi XE4 > Project > Deployment 我有一个名为“res.zip”的文件的引用它被设置为放置在远程路径“res.zip”
但是,“FileExists”在底层代码中返回 false(在 iOS 6.1 模拟器中运行):
procedure TFormMain.InitCreate_Uncompress;
var
H: string;
P: string;
Z: TZipFile;
begin
H := GetHomePath;
P := H + PathDelim + 'res.zip';
if FileExists(P) then
begin
Z := TZipFile.Create;
try
Z.Open(P, zmRead);
Z.ExtractAll(H + PathDelim + 'Library');
finally
Z.Free;
end;
end
;
end;
【问题讨论】:
-
当您在
if FileExists
行上设置调试器断点并查看P
中的确切值时,您会看到什么? -
用 Path.Combine 组合路径元素
-
P is = '/Users/%user%/Library/Application Support/iPhone Simulator/6.1/Applications/BF8E7DA7-B92B-4AE7-9C98-7AC8DC223D16/res.zip'(其中 %user%是我的用户名)
-
@David 在调试期间检查路径时看起来正确。我对 iOS/模拟器路径做错了吗?
标签: ios delphi delphi-xe4