有一个很好的方法来备份Core Data数据库与iCloud集成? [英] Is there a good way to backup Core Data database with iCloud integration?

查看:233
本文介绍了有一个很好的方法来备份Core Data数据库与iCloud集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个很好的方法来备份我的sqlite信息从iCloud,如果CoreData sqlite + iCloud破坏?将.sqlite复制到另一个位置?当iCloud损坏时,从.sqlite读取数据以创建新的iCloud sqlite?

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?

推荐答案

使用migratePersistentStore API创建存储文件的副本,位于将要备份的设备/ Documents目录中。请参阅此处,了解更完整的说明和示例应用。

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 /

这篇关于有一个很好的方法来备份Core Data数据库与iCloud集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆