Core Data新手,在persistentStoreCoordinator中获取错误
我刚开始学习使用Core Data。 在我第一次尝试将对象添加到数据库时,我收到以下内容:
2011-08-03 15:21:32.519 StuffNearMe[45040:15503] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn't be completed. (Cocoa error 134100.)" UserInfo=0x81f03d0 {metadata={type = immutable dict, count = 7, entries => 2 : {contents = "NSStoreModelVersionIdentifiers"} = {type = immutable, count = 1, values = ( 0 : {length = 0, capacity = 0, bytes = 0x} )} 4 : {contents = "NSPersistenceFrameworkVersion"} = {value = +363, type = kCFNumberSInt64Type} 6 : {contents = "NSStoreModelVersionHashes"} = {type = immutable dict, count = 2, entries => 1 : {contents = "FavoriteAddress"} = {length = 32, capacity = 32, bytes = 0x0716904fb7c1b83554338231858021ed ... a0b76e5dbab42a40} 2 : {contents = "RecentAddress"} = {length = 32, capacity = 32, bytes = 0x9406126d6ea281dc3e96eed795fc67d8 ... 176c5845b46ca895} } 7 : {contents = "NSStoreUUID"} = {contents = "D4569F82-247B-4D4E-99DA-990570C0E6B5"} 8 : {contents = "NSStoreType"} = {contents = "SQLite"} 9 : {contents = "_NSAutoVacuumLevel"} = {contents = "2"} 10 : {contents = "NSStoreModelVersionHashesVersion"} = {value = +3, type = kCFNumberSInt32Type} } , reason=The model used to open the store is incompatible with the one used to create the store}, { metadata = { NSPersistenceFrameworkVersion = 363; NSStoreModelVersionHashes = { FavoriteAddress = ; RecentAddress = ; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( ); NSStoreType = SQLite; NSStoreUUID = "D4569F82-247B-4D4E-99DA-990570C0E6B5"; "_NSAutoVacuumLevel" = 2; }; reason = "The model used to open the store is incompatible with the one used to create the store"; }
任何帮助或建议将不胜感激! 首次开始使用时,核心数据非常混乱。
错误是:
用于打开商店的模型与用于创建商店的模型不兼容
这可能是因为您在第一次创建模型后更改了模型。 如果需要在创建模式后更改模式,请查看“ 核心数据模型版本控制和数据迁移编程指南” 。