Delphi XE4 iOS应用程序可在Simualtor上运行,但不能在调试设备上运行 [英] Delphi XE4 iOS app works on simualtor but not on debug device

查看:113
本文介绍了Delphi XE4 iOS应用程序可在Simualtor上运行,但不能在调试设备上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我让应用在加载时显示其指定的背景图片。然后,它将在启动时运行以下代码而崩溃:

I have the app showing its designated background image while app loads. It then crashes running this code at startup:

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

这是我得到的错误:

推荐答案

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

The problem is that you're using the wrong method to get the locations.

切换为使用 System.IOUtils.TPath ,使用 TPath.GetHomePath 获取主文件夹, TPath .GetDocumentsPath 用于 Documents 文件夹,以及 TPath.GetLibraryPath 以获得 Library 文件夹位置上。

Switch to using System.IOUtils.TPath, using TPath.GetHomePath to get the home folder, TPath.GetDocumentsPath for the Documents folder, and TPath.GetLibraryPath to get the Library folder location.

这篇关于Delphi XE4 iOS应用程序可在Simualtor上运行,但不能在调试设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆