简体   繁体   English

iOS中的永久文件位置

[英]Permanent File Location In iOS

When deploying to an iOS, the documents path of the previous copy of the app is deleted and a new documents path is created and the files are copied to that new path. 部署到iOS时,将删除该应用程序的上一个副本的文档路径,并创建一个新的文档路径,并将文件复制到该新路径。

What if you want to place a file that you do not want to get deleted each time you redeploy your app? 如果您希望放置一个不想在每次重新部署应用程序时都被删除的文件,该怎么办? Is this possible and if so where is a good location to place this file? 这可能吗?如果可以,在哪里放置此文件?

Thanks. 谢谢。

You are talking about when you compile and deploy from Delphi to the device. 您所谈论的是何时从Delphi编译并部署到设备。 It uninstalls the previous deployment of the app first before it installs the new deployment. 在安装新部署之前,它将首先卸载该应用程序的先前部署。 Naturally this deletes everything in the app sandbox. 自然,这会删除应用程序沙箱中的所有内容。

Normally, in real life this would not be a problem because updating an app to a newer version from the app store leaves alone anything that is in the Documents directory. 通常,在现实生活中,这不会有问题,因为将应用程序从应用程序商店更新到较新版本时,文档目录中的所有内容都将被保留。

This applies to XE5 and older. 这适用于XE5及更早版本。 In XE6 this behavior has been changed. 在XE6中,此行为已更改。 In XE6 the deployment to device leaves the old documents, data and cache directories alone, so the old stuff stays there. 在XE6中,设备部署仅保留旧文档,数据和缓存目录,因此旧内容保留在那里。 And there is an optional switch to do it the old way and delete everything. 并且有一个可选的开关可以用旧的方式进行操作并删除所有内容。

So, the solution is to upgrade to XE6. 因此,解决方案是升级到XE6。 There is no other known way. 没有其他已知方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM