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

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

// 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 ; 

这是我得到的错误:

在此处输入图像描述

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

切换到使用System.IOUtils.TPath ,使用TPath.GetHomePath获取主文件夹, TPath.GetDocumentsPath Documents文件夹的TPath.GetDocumentsPath ,使用TPath.GetHomePath获取Library文件夹位置。