CoreDataで下記のようなエラー
一度は動いたのにと思っていると原因は、
「1度エントリを作ってからCoreDataのModelを変えたこと」だった。
iPhoneを接続してテストをしていたのでデータがiPhone上のアプリに残り続けていた。
そこで新しいModelと不一致が起きていたよう。
一度アプリを削除してデータを消してから再度runすると問題なく動き出した。
Cleanではデータが消えないのでダメ
CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///Users/Patti/Library/Developer/CoreSimulator/Devices/A70306D7-76BE-489A-82B3-FBAA9390D5A4/data/Containers/Data/Application/FC51C1B7-416B-463E-B976-C175642A4B34/Documents/Note_App.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x7fa79add8080 {metadata={
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Notes = <674765e4 00e077d5 e3b4d2ca 2795eee2 42850989 4a2a825a 0c289097 387aa3a5>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "8348BBED-7C75-4EF5-B73C-075E8719696E";
"_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 = {
Notes = <674765e4 00e077d5 e3b4d2ca 2795eee2 42850989 4a2a825a 0c289097 387aa3a5>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "8348BBED-7C75-4EF5-B73C-075E8719696E";