Is there a good way to backup Core Data database with iCloud integration?

☆樱花仙子☆ 提交于 2019-12-13 01:03:59

问题


Is there a good way to backup my sqlite information from iCloud in case CoreData sqlite + iCloud corrupts? Copying the .sqlite to another location? When the iCloud corrupts, reading the data out from the .sqlite to create a new iCloud sqlite?


回答1:


use migratePersistentStore API to create a copy of the store file in the devices /Documents directory where it will get backed up. See here for a more complete explanation and a sample app.

http://ossh.com.au/design-and-technology/software-development/sample-library-style-ios-core-data-app-with-icloud-integration/



来源:https://stackoverflow.com/questions/15694426/is-there-a-good-way-to-backup-core-data-database-with-icloud-integration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!