Delphi XE4 iOS应用程序适用于simualtor,但不适用于调试设备

Tom*_*Tom 5 delphi ios

我在应用程序加载时让应用程序显示其指定的背景图像.然后它在启动时崩溃运行此代码:

  // unzip own resources like images, data files ettc. 
  FAppDataDirPath := GetHomePath + PathDelim + Application.Title + '.app' + PathDelim;
  P := FAppDataDirPath + 'assets.zip';
  if FileExists(P) then
    begin
      Z := TZipFile.Create;
      try
        Z.Open(P, zmRead);
        Z.ExtractAll(FAppDataDirPath + 'Library');
      finally
        Z.Free;
      end;
    end
  ;
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

在此输入图像描述

Ken*_*ite 3

问题是您使用了错误的方法来获取位置。

切换到 using System.IOUtils.TPath,使用TPath.GetHomePath获取主文件夹、TPath.GetDocumentsPath文件Documents夹以及TPath.GetLibraryPath获取Library文件夹位置。