简体   繁体   English

如何在无需身份验证的情况下将核心数据保留在云中

[英]How to persist core data in cloud without authentication

I am designing an app using core data which has a local Cache . 我正在设计使用具有本地Cache core data的应用程序。 I am thinking of using CloudKit for syncing it across multiple iOS devices. 我正在考虑使用CloudKit在多个iOS设备上同步它。 Since CloudKit is not for persisting data, I am pretty sure that if user loses their phone that data is gone forever. 由于CloudKit不是用于persisting数据,因此,我非常确定,如果用户丢失手机,数据将永远消失。 My app doesn't require any authentication so how do I save the data in cloud along with local Cache so that it can be sync across multiple iOS devices like iPad or iWatch 我的应用程序不需要任何身份验证,因此如何将数据与本地Cache一起保存在云中,以便可以在多个iOS设备(如iPadiWatch之间同步数据

PS Is it possible to save user generated content files in Documents so that they can get backed up by iCloud automatically without using CloudKit ? PS是否可以将用户生成的内容files保存在“ Documents以便它们可以通过iCloud自动备份而无需使用CloudKit

数据会定期在iTunes和iCloud上备份,因此,如果您的用户更换设备,则可以从那里还原数据。是的,可以将用户生成的内容文件保存在“文档”中,这样​​它们就可以自动由iCloud备份,而无需使用CloudKit

As per your problem , Only creating Coredata enables you to manage data across different devices but two important question need to understand before this : 根据您的问题,只有创建Coredata使您跨不同的设备管理数据,但是在此之前需要了解两个重要的问题:

  1. How can you preload existing data into the SQLite database ? 如何将现有数据预加载到SQLite database
  2. How can you use an existing SQLite database in Xcode project? 如何在Xcode项目中使用现有的SQLite数据库?

Here is one of hot favourite tutorial for managing this : 这是管理此问题的热门教程之一:

https://www.raywenderlich.com/27657/how-to-perform-a-lightweight-core-data-migration https://www.raywenderlich.com/27657/how-to-perform-a-lightweight-core-data-migration

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

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