删除带有已启用iCloud的文件夹中的文档的iOS应用 [英] Deleting an iOS App with documents in the iCloud-enabled folder

查看:141
本文介绍了删除带有已启用iCloud的文件夹中的文档的iOS应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现,如果我从设备中删除某个应用程序,则当然会删除所有本地文档,但是如果该应用程序中的文件存储在启用了iCloud的文件夹([[[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil])中,则不会删除这些文件. /p>

这会导致两个问题:

  • 这些文件占用的存储空间不会释放.
  • 如果用户重新安装该应用程序,则该文件夹中已经有文件,这会干扰正常的初始化.

我可以通过在第一次启动时浏览目录并删除其中的所有内容来解决第二个问题,但这似乎有点尴尬.

我想不出解决第一个问题的方法.

有什么想法吗?

解决方案

iOS会自动清除iCloud目录中的文件以释放空间.您也可以专门从应用程序中逐出"文件,但是由于您要解决的是删除应用程序的情况,因此可能不会有太大帮助.

有关更多信息,请参见developer.apple.com/icloud上的视频.

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?

解决方案

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.

这篇关于删除带有已启用iCloud的文件夹中的文档的iOS应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆