[英]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
设备(如iPad
或iWatch
之间同步数据
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
使您跨不同的设备管理数据,但是在此之前需要了解两个重要的问题:
SQLite database
? 如何将现有数据预加载到SQLite database
? 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.