1. 程式人生 > >Core Dataeasy出現的錯誤

Core Dataeasy出現的錯誤

當前 library popu min enc open documents ng- ons

1、2015-08-24 15:52:17.674 Tasks[3189:144763] CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/zhumin/Library/Developer/CoreSimulator/Devices/09E156EA-B44B-4CCA-9E32-9286D332DDF0/data/Containers/Data/Application/4E9E83E8-DA35-4AE8-81FD-EBD9C09D17D6/Documents/Tasks.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x7fc84366ed60 {metadata={
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Event = <5431c046 d30e7f32 c2cc8099 58add1e7 579ad104 a3aa8fc4 846e97d7 af01cc79>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "4EE0C579-E3F8-48CC-ACFF-26CBCB386C37";
"_NSAutoVacuumLevel" = 2;
}, reason=The model used to open the store is incompatible with the one used to create the store} with userInfo dictionary {
metadata = {
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Event = <5431c046 d30e7f32 c2cc8099 58add1e7 579ad104 a3aa8fc4 846e97d7 af01cc79>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "4EE0C579-E3F8-48CC-ACFF-26CBCB386C37";
"_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store";

}

1、ps:上面的錯誤方法是相應的數據庫沒有創建成功。這個要註意我們在寫屬性指的設置的時候要相應。


2015-08-24 15:52:17.675 Tasks[3189:144763] Unresolved error Error Domain=YOUR_ERROR_DOMAIN Code=9999 "Failed to initialize the application‘s saved data" UserInfo=0x7fc843712020 {NSLocalizedFailureReason=There was an error creating or loading the application‘s saved data., NSLocalizedDescription=Failed to initialize the application‘s saved data, NSUnderlyingError=0x7fc84366ede0 "The operation couldn’t be completed. (Cocoa error 134100.)"}, {
NSLocalizedDescription = "Failed to initialize the application‘s saved data";
NSLocalizedFailureReason = "There was an error creating or loading the application‘s saved data.";
NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=134100 \"The operation couldn\U2019t be completed. (Cocoa error 134100.)\" UserInfo=0x7fc84366ed60 {metadata={\n NSPersistenceFrameworkVersion = 519;\n NSStoreModelVersionHashes = {\n Event = <5431c046 d30e7f32 c2cc8099 58add1e7 579ad104 a3aa8fc4 846e97d7 af01cc79>;\n };\n NSStoreModelVersionHashesVersion = 3;\n NSStoreModelVersionIdentifiers = (\n \"\"\n );\n NSStoreType = SQLite;\n NSStoreUUID = \"4EE0C579-E3F8-48CC-ACFF-26CBCB386C37\";\n \"_NSAutoVacuumLevel\" = 2;\n}, reason=The model used to open the store is incompatible with the one used to create the store}";
}
(lldb)

2、這個出現錯誤的程度最高的就是:“用於打開存儲的模型和用於創建存儲的模型不兼容”
ps:須要使用Core Data遷移將數據從一個數據模型遷移到另外一個模型。(這個還沒有學到)
如今解決方案:聽過刪除模擬器生成的app,然後再一次執行,
強制Core Data創建兼容當前數據模型的新的數據存儲。




Core Dataeasy出現的錯誤