删除应用程序不应删除文档目录

Deleting App should not delete Document Directory

如果iOS 应用程序被取消安装或任何其他方式

,有什么方法可以不删除文档目录

有没有什么办法可以把数据保存在不同的地方,以便删除应用程序后我们可以使用它?

不,一旦您卸载应用程序无法阻止系统删除文档文件夹

并且如果在设备中启用了 iCloud,它将备份 Documents 目录的内容。 iCloud方式是最有效的,它自动处理文档文件夹内容,重装后从备份中恢复数据,所以你可以重复使用。

Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the /Documents directory and will be automatically backed up by iCloud.

更多:https://developer.apple.com/icloud/documentation/data-storage/index.html

用户可能还使用 iTunes 备份了这些数据。

阅读更多关于文件系统和逻辑的信息:

https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html