简体   繁体   English

在更新和同步到iCloud时将程序数据保留在iOS应用中

[英]retain program data in iOS app while updating and sync to iCloud

When a new upgrade is released and installed on iOS, which folders / files are left untouched by the upgrade process? 在iOS上发布并安装新的升级时,升级过程中不影响哪些文件夹/文件? There are several folders; 有几个文件夹。 Library, Caches, Preferences, Documents. 库,缓存,首选项,文档。

Normally Application Support Directory is not created by default. 通常,默认情况下不会创建Application Support Directory。 What happen to AS folder during upgrade? 升级期间AS文件夹会发生什么?

I learn that all data in Documents folder will copy to iTunes or iCloud by default. 我了解到,默认情况下,Documents文件夹中的所有数据都将复制到iTunes或iCloud。 Is that true? 真的吗?

If I create my own CoreData db to persist, where should I keep? 如果我创建自己的CoreData数据库以保留,我应该保留在哪里?

Your best bet is to read the first half (which pertained to iOS) of this document from Apple : 最好的选择是从Apple阅读本文档的前半部分(与iOS相关):

In my experience, I put Core Data db in Documents folder if the iTunes File Sharing feature was not enabled on your app. 以我的经验,如果未在您的应用程序上启用iTunes File Sharing功能,我会将Core Data db放在Documents文件夹中。 Otherwise create a folder in the Library folder called Application Support or anything name, etc. With iTunes File Sharing enabled, user can accidentally delete any files in the Documents folder. 否则,请在“资料库”文件夹中创建一个名为“应用程序支持”或任何名称等的文件夹。启用iTunes文件共享后,用户可能会意外删除“文档”文件夹中的任何文件。

During the upgrade, the contents of Library and Documents folder are retained. 在升级过程中,将保留“库和文档”文件夹的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM