Deleting an iOS App with documents in the iCloud-enabled folder

旧城冷巷雨未停 提交于 2019-12-08 07:33:18

问题


I found out that if I delete an App from the device, all local documents are deleted of course, but if the App has files stored in the iCloud-enabled folder ([[[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]) - These files are not deleted.

This causes two problems:

  • The storage taken by these files is not freed.
  • If the user re-installs the App, there are already files in the folder, which disrupts normal initialization.

I can take care of the second issue by going through the directory on first launch and deleting everything in there, but it seems a bit awkward.

I can't think of a way to take care of the first issue.

Any ideas?


回答1:


iOS automatically purges files in the iCloud directory to free up space. You may also specifically "evict" files from your app, but since you are addressing the scenario in which the app is deleted, that probably won't be much help.

See the videos at developer.apple.com/icloud for more info.



来源:https://stackoverflow.com/questions/11431115/deleting-an-ios-app-with-documents-in-the-icloud-enabled-folder

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