Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi XE4 iOS app works on simualtor but not on debug device

Tags:

ios

delphi

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
  ;

This is the error I get:

enter image description here

like image 521
Tom Avatar asked Oct 21 '22 05:10

Tom


1 Answers

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

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.

like image 169
Ken White Avatar answered Oct 30 '22 16:10

Ken White