Which directories are deleted in the sandbox of an App during update

ε祈祈猫儿з 提交于 2019-11-29 21:15:37

问题


I cache some downloaded information in the NSLibraryDirectory in an App. However after a recent update the users report having problems accessing the previously downloaded content in the Library directory.

Which directories are safe to cache information over new app versions? Is there any Apple documentation on this? I couldn't find any...

thanks a lot, e.


回答1:


from Apple Application Programming Guide:

Files Saved During Application Updates When a user downloads an application update, iTunes installs the update in a new application directory. It then moves the user’s data files from the old installation over to the new application directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:

<Application_Home>/Documents
<Application_Home>/Library 

Although files in other user directories may also be moved over, you should not rely on them being present after an update.




回答2:


Note, however, that /Library/Caches is not preserved across updates; it's not even backed up.



来源:https://stackoverflow.com/questions/4668165/which-directories-are-deleted-in-the-sandbox-of-an-app-during-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!