2014-02-28 62 views
0

我在Xcode中的新項目中添加預填充數據時出現此錯誤。核心數據 - 預填充數據時不兼容模型

Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x8936000 {metadata={ 
    NSPersistenceFrameworkVersion = 407; 
    NSStoreModelVersionHashes =  { 
     Cleaner = <bb90421c 1d099882 3b9c4615 f58bb6d2 b9f1e567 c98e868e 5f467f7c d34be700>; 
     Location = <7f9bec7a 3e3692f8 ca426545 7239c5c8 ea704142 8614e1fd 7681eaaf 5dbb1586>; 
     LocationRoomMap = <f1052409 bfe4fb62 b7c45b85 2f34ab74 109c09df 07bc69ff a1a130bc 3dd23ced>; 
     Login = <39315a04 8bf4a9f5 e1fd123d 41854f3c 8891af2b ddffdb43 2fa32209 574af392>; 
     Room = <d07972d5 5b089bdd 2fa7afde f723f5a8 abb7548d 9cfe9fc6 bb343b9d 3094d12e>; 
     TestPlan = <e47ccac2 197bd2a1 41e295b2 66fcc993 1671b53d 88b90334 3942dab4 1eed766e>; 
     TestPoint = <e6806bd5 bba33811 c55ea3cd 8d8e0c89 9a8742f2 5c7b19f9 d285b7d2 ae5eab96>; 
    }; 
    NSStoreModelVersionHashesVersion = 3; 
    NSStoreModelVersionIdentifiers =  (
     "" 
    ); 
    NSStoreType = SQLite; 
    NSStoreUUID = "3D9D9EB1-5ED3-47DB-8B76-F6E4051B435E"; 
    "_NSAutoVacuumLevel" = 2; 
}, reason=The model used to open the store is incompatible with the one used to create the store}, { 
    metadata =  { 
     NSPersistenceFrameworkVersion = 407; 
     NSStoreModelVersionHashes =   { 
      Cleaner = <bb90421c 1d099882 3b9c4615 f58bb6d2 b9f1e567 c98e868e 5f467f7c d34be700>; 
      Location = <7f9bec7a 3e3692f8 ca426545 7239c5c8 ea704142 8614e1fd 7681eaaf 5dbb1586>; 
      LocationRoomMap = <f1052409 bfe4fb62 b7c45b85 2f34ab74 109c09df 07bc69ff a1a130bc 3dd23ced>; 
      Login = <39315a04 8bf4a9f5 e1fd123d 41854f3c 8891af2b ddffdb43 2fa32209 574af392>; 
      Room = <d07972d5 5b089bdd 2fa7afde f723f5a8 abb7548d 9cfe9fc6 bb343b9d 3094d12e>; 
      TestPlan = <e47ccac2 197bd2a1 41e295b2 66fcc993 1671b53d 88b90334 3942dab4 1eed766e>; 
      TestPoint = <e6806bd5 bba33811 c55ea3cd 8d8e0c89 9a8742f2 5c7b19f9 d285b7d2 ae5eab96>; 
     }; 
     NSStoreModelVersionHashesVersion = 3; 
     NSStoreModelVersionIdentifiers =   (
      "" 
     ); 
     NSStoreType = SQLite; 
     NSStoreUUID = "3D9D9EB1-5ED3-47DB-8B76-F6E4051B435E"; 
     "_NSAutoVacuumLevel" = 2; 
    }; 
    reason = "The model used to open the store is incompatible with the one used to create the store"; 
} 

我想...重置內容和設置..數據模型的模型版本..但沒有工作......但是如果只有一個實體存在,然後心不是任何像這樣的錯誤。這有多個實體時出現錯誤。

回答

2

我有一個類似的問題(雖然不是完全相同),這是由於我在創建SQLite數據庫文件後對模型進行了更改而導致的。我不得不從Debug文件夾中刪除SQLite數據庫(應該在應用程序編譯到的地方創建它),然後再次構建應用程序。我的更新模型創建了一個新的SQLite數據庫。希望這是有道理的,並有一定的幫助。

更新時間:

The model used to open the store is incompatible with the one used to create the store

+0

嘿cullener ...我在iPhone模擬器中運行這個程序..可以請你告訴我:

這等建議的解決方案可以在其他地方計算器上找到這個文件夾[Debug文件夾(應該在應用程序編譯到的地方創建)]是? –

+0

你的意思是應用程序被裝箱的庫中的文件夾?我試過那個..我刪除它..甚至從垃圾桶,但它的工作 –

+0

有一個在/庫/開發/ Xcode/DerivedData一個文件夾,以您的應用程序的名稱開始看看。在那裏查看是否有一箇舊版本的SQLite數據庫 – cullener