ios - 持久存储在大量迁移中找不到迁移策略类

标签 ios macos cocoa core-data core-data-migration

我收到此错误:

2015-12-29 03:13:41.603 n-back project[21345:474175] CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/Nathan/Library/Developer/CoreSimulator/Devices/EC2C60E2-9FC8-40D7-B16F-15960AA6B42A/data/Containers/Data/Application/8F8132B0-76E9-491E-BA1B-27A5D78CE7D0/Documents/data.sqlite options:{
    NSMigratePersistentStoresAutomaticallyOption = 1;
} ... returned error Error Domain=NSCocoaErrorDomain Code=134110 "(null)" UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (BTRPolicy)} with userInfo dictionary {
    NSUnderlyingException = "Couldn't create mapping policy for class named (BTRPolicy)";
}
2015-12-29 03:13:41.608 n-back project[21345:474175] Unresolved error Error Domain=YOUR_ERROR_DOMAIN Code=9999 "Failed to initialize the application's saved data" UserInfo={NSLocalizedDescription=Failed to initialize the application's saved data, NSUnderlyingError=0x7b14eef0 {Error Domain=NSCocoaErrorDomain Code=134110 "(null)" UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (BTRPolicy)}}, NSLocalizedFailureReason=There was an error creating or loading the application's saved data.}, [NSLocalizedDescription: Failed to initialize the application's saved data, NSUnderlyingError: Error Domain=NSCocoaErrorDomain Code=134110 "(null)" UserInfo={NSUnderlyingException=Couldn't create mapping policy for class named (BTRPolicy)}, NSLocalizedFailureReason: There was an error creating or loading the application's saved data.]

在我看来,找到 BTRPolicy 类时遇到问题。它存在于 BTRPolicy 文件中,名称为 BTRPolicy。它被正确子类化,并在实用程序 Pane 上的自定义策略选择中被引用为“BTRPolicy”。有什么想法吗?

最佳答案

如果其他人遇到这个问题并且这与您的谷歌搜索相匹配:我发现了,出于某种原因,自定义策略现在需要以模块名称为前缀。

关于ios - 持久存储在大量迁移中找不到迁移策略类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34507210/

相关文章:

objective-c - 如何使用自定义 View 隐藏菜单项?

iOS - 是否有其他像 KeyChain 这样安全但在删除应用程序时被删除的东西?

iOS NSLog %hd %hhd %ld 和 %lld 格式说明符

ios - 在 ipad 上运行应用程序一次又一次地要求输入系统用户名和密码

objective-c - 在 otest 下运行 Cocoa 应用程序会导致 Release 模式下出现 dyld_misaligned_stack_error

objective-c - 如何在 cocoa 中显示一个弹出窗口,通知 NSTextField 不能为空?

iphone - 如何在iphone上缓存xml数据

ios - if 语句中的 switch 语句

ruby - 错误 : inreplace failed while installling with homebrew?

objective-c - 返回 NSTextView 的选择属性