简体   繁体   中英

How to persist core data in cloud without authentication

I am designing an app using core data which has a local Cache . I am thinking of using CloudKit for syncing it across multiple iOS devices. Since CloudKit is not for persisting data, I am pretty sure that if user loses their phone that data is gone forever. 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

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 ?

数据会定期在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 :

  1. How can you preload existing data into the SQLite database ?
  2. How can you use an existing SQLite database in Xcode project?

Here is one of hot favourite tutorial for managing this :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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