views:

159

answers:

1

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.

+1  A: 

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.

mikecsh
During development, it is fine to delete the data store and repopulate it. In production, this obviously not viable. Have a read over the Model Versioning Programming Guide (http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreDataVersioning/Introduction/Introduction.html)
Barry Wark
Note that the question is from an iPhone tag so the database is stored in the simulator. Reset the simulator or delete the app from the simulator.
Marcus S. Zarra