开发者

Core Data and many Entity

开发者 https://www.devze.com 2022-12-28 06:30 出处:网络
I\'m newbie and I must save \"Ranking\" and \"Level\" of user. I create file Ranking.xcdatamodel for save \"Ranking\"

I'm newbie and I must save "Ranking" and "Level" of user. I create file Ranking.xcdatamodel for save "Ranking" with entity name Ranking (property is Rank, Name) I can save and show it.

But when I create开发者_如何学编程 entity Level (property is CurrentLevel) my program is crash and show this message:

Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 UserInfo=0x60044b0 "Operation could not be completed. (Cocoa error 134100.)", { metadata = { NSPersistenceFrameworkVersion = 248; NSStoreModelVersionHashes = { Users = ; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( ); NSStoreType = SQLite; NSStoreUUID = "41225AD0-B508-4AA7-A5E2-15D6990FF5E7"; "_NSAutoVacuumLevel" = 2; }; reason = "The model used to open the store is incompatible with the one used to create the store"; }

I don't know how to save "Level" please suggest me.


The problem is you have saved data based on one model, then changed that model and tried to re-open the same file.

You need to delete the saved file which will be (I think, from top of my head) in the ~/user/Library/ApplciationSupport/YourAppName directory, unless you are developing a document based application.

Then re-run your application and re-enter and re-save your data.

0

精彩评论

暂无评论...
验证码 换一张
取 消