[英]iOS App update new version delete files from Documents folder
I have written a new version (1.0.1) of the iOS application. 我已经编写了iOS应用程序的新版本(1.0.1)。 The background of the application is that it download files from server and stores in Documents.
该应用程序的背景是它从服务器下载文件并存储在Documents中。 As per Apple guidelines, any file generated by user shouldn't be backed up on cloud, therefore I have marked them as NSURLIsExcludedFromBackupKey.
根据Apple指南,用户生成的任何文件都不应在云上备份,因此我将其标记为NSURLIsExcludedFromBackupKey。 But now when I am updating on the device using Adhoc distribution profile, any user generated file in Documents folders are getting deleted.
但是现在当我使用Adhoc分发配置文件在设备上更新时,Documents文件夹中的任何用户生成的文件都将被删除。
Is there any way to avoid the deletion of those files, as these are essential files to have for application to run. 有没有办法避免删除这些文件,因为这些是运行应用程序的必备文件。
You seem to have things backwards. 你好像倒退了。 You should backup user-generated files.
您应该备份用户生成的文件。 What you should not backup are files that can easily be replaced by downloading them again or generating them again as needed.
您不应该备份的文件是可以通过再次下载或根据需要再次生成它们来轻松替换的文件。
If you mark a file so it is excluded from backup then that means the file can easily be replaced. 如果您将文件标记为从备份中排除,那么这意味着可以轻松替换该文件。
When you install the app update, those files aren't copied over to the updated app. 安装应用程序更新时,这些文件不会复制到更新的应用程序。 On first run, your app should detect that they are missing and automatically replace them if needed.
首次运行时,您的应用应检测到它们丢失,并在需要时自动替换它们。
If these are files that can't be replaced automatically then do not flag them with NSURLIsExcludedFromBackupKey
. 如果这些文件无法自动替换,请不要使用
NSURLIsExcludedFromBackupKey
标记它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.