问题
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