【发布时间】:2012-09-27 02:07:54
【问题描述】:
我目前正在为 Core Data iCloud 迁移而苦苦挣扎。
我想将商店从 iCloud 通用容器 (.nosync) 移动到本地 URL。问题是,每当我这样称呼时:
[self.persistentStoreCoordinator migratePersistentStore: currentiCloudStore
toURL: localURL
options: nil
withType: NSSQLiteStoreType
error: &error];
我收到此错误:
-[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1055): CoreData: Ubiquity: Error: A persistent store which has been previously added to a coordinator using the iCloud integration options must always be added to the coordinator with the options present in the options dictionary. If you wish to use the store without iCloud, migrate the data from the iCloud store file to a new store file in local storage. file://localhost/Users/sch/Library/Containers/bla/Data/Documents/tmp.sqlite. This will be a fatal error in a future release
有人见过这个吗?也许我只是缺少正确的迁移选项?
【问题讨论】:
-
这是一个 UIManagedDoc 还是一个独立的数据库? UIManagedDoc 在包的根目录有一个 plist。
-
没有 UIManagedDoc。这是一个“鞋盒”核心数据设置。
-
忘了提到我在 mac 应用程序 (10.8.2) 中遇到此错误。尚未在 iOS 上尝试过。
-
啊。我知道了 。尝试直接复制文件而不是托管迁移。然后,您可以使用该文件重新启动新的 PSC。
-
我收到了同样的信息。我有两个版本的应用程序也使用“鞋盒”模型。一个版本有 iCloud,一个没有。我已经能够毫无问题地在应用程序之间复制数据库。现在有了 iOS 6,我也收到了消息。我很想听到任何解决方案。
标签: objective-c cocoa core-data migration icloud