问题
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