0

I have created a core data model and when trying to save records I get the following console message: Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x8b3bc50 {metadata={ NSPersistenceFrameworkVersion = 479; NSStoreModelVersionHashes = { }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( "" ); NSStoreType = SQLite; NSStoreUUID = "F49C0E04-9778-46EC-A9C7-9A045CD915D8"; "_NSAutoVacuumLevel" = 2; }, reason=The model used to open the store is incompatible with the one used to create the store}, { metadata = { NSPersistenceFrameworkVersion = 479; NSStoreModelVersionHashes = { }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( "" ); NSStoreType = SQLite; NSStoreUUID = "F49C0E04-9778-46EC-A9C7-9A045CD915D8"; "_NSAutoVacuumLevel" = 2; }; reason = "The model used to open the store is incompatible with the one used to create the store"; }

I am not sure where to start to debug it please can someone tell me where the problem could be as I am new to core data.

  • Did you make a change to the model? Any time you change the model, you need to delete the app from the Simulator or the iphone and re-run it – logixologist Dec 04 '13 at 23:37
  • The error is giving you this explanation: `The model used to open the store is incompatible with the one used to create the store` – logixologist Dec 04 '13 at 23:38
  • check out my answer here, you need to version your Core Data Model for every set of changes you make to it. http://stackoverflow.com/questions/20364660/modifying-the-core-data-model-requires-new-version-every-time/20364770#20364770 – Patrick Goley Dec 04 '13 at 23:45

1 Answers1

1

Remove your app from the simulator or device, clean the project and run it again.

Update: Do this only for development stages and be sure to understand the model versioning like Patrick Goley stated below.

anka
  • 3,817
  • 1
  • 30
  • 36
  • this is an incomplete answer. OP doesn't understand model versioning, which can create big problems if he ships a bad model version because you convinced him it's only a problem with the simulator – Patrick Goley Dec 04 '13 at 23:44
  • @PatrickGoley that cannot be inferred either that he might ship an app that way. being that he is saying he created a core data model and its not working likely means its the 1st go around. He likely created the datamodel used it then changed something. – logixologist Dec 04 '13 at 23:48
  • But i do agree its an incomplete answer and should be better detailed. – logixologist Dec 04 '13 at 23:49