Core Data; Cocoa error 134100

Here's the reason:

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

And here's how you did it:

  1. You created some entities with some attributes and wrote some code
  2. Launched the app, probably added some content
  3. Quit the app and added/changed some more entities with attributes
  4. You probably launched the app again and now it's giving you the error

The reason for this is because your new managed object model is trying to use older version of storage (the one first time created when you launched the app).

The quick and dirty fix would be to remove the storage file (somewhere in ~/Library/Application Support/YOUR_APP/) and to launch your app again.

For future reference - if you release an app and in next release the app has changed managed object model - you have to write migrations for it. All this and more is covered in core data programming cookbook in apple documentation.


You should do following steps

  1. Delete the application and Run it again, if it still shows the same error. Then it means that, you used the specific attributes/attribute with different type.
  2. Go to your .xcdatamodeled file and check the type of each attributes.
  3. Go to your code and check, while inserting the attributes/objects in core data, you used the same type of different. So, the point is type(NSString, NSDate...) of the attributes/objects in your code and .xcdatamodeled should be same. If not then it will give the error "Error Domain=NSCocoaErrorDomain Code=134100"

It should be enough if you remove the app from your simulator/device.

You don't have to change the files in your project (except choosing a current model and replacing the classes using menu: Editor/Create NSManaged Object Subclass).