与核心数据崩溃

时间:2012-04-26 14:18:52

标签: objective-c ios

我发生了崩溃,在我的控制台中我收到了这个错误:

Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x6d30540 {metadata=<CFBasicHash 0x6d2c680 [0x171bb38]>{type = immutable dict, count = 7,
entries =>
.....
.....

reason = "The model used to open the store is incompatible with the one used to create the store";

你看到了这个的原因,对不起,我是Core Data的新手。 感谢

2 个答案:

答案 0 :(得分:1)

在设备上删除您的应用程序,通过管理器删除派生数据并再次部署。当您更改核心数据模型并在设备上保留旧版本时,会出现此错误。因此,每次构建核心数据模型后,您都需要删除设备上的当前版本。

更多信息可在Core Data Model Versioning and Data Migration Programming Guide

中找到

答案 1 :(得分:0)

看起来您在不更新数据库本身的情况下更改了数据模型。如果您有预先填充的数据库,那么您的模型不符合您的模型。如果您不这样做,则需要进行全新安装以创建新数据库。