Frage

I am creating an application using Core Data. But When I run my app it crashes. It shows me this reason:

reason = "The model used to open the store is incompatible with the one used to create the store";

What should I do now?

War es hilfreich?

Lösung

I think you need to refer this link and refer to answer given by Grouchal in the link below:

What do I have to do to get Core Data to automatically migrate models?

If you need any further help please do let me know.

Hope this helps you.

Andere Tipps

It means that you created a model, run the app, modified the model (by adding or removing managed objects, renaming object properties and so on...) and reopened the app without migrating the data first. I still have to try this by myself but, you should definitely take a look here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreDataVersioning/Introduction/Introduction.html

You can just delete the app (icon) from the simulator or device. Then, rebuild and run.

As dave explained, you have modified the core data structure (the store). If you're using the standard template, in the new rebuild a new model (NSManagedObjectModel) will be created that is compatible with your newly modified store.

You will probably be making many changes to the core data structure (adding or deleting an entity or some property or relationship), and, each time you do, you can just delete the app from the simulator or device.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top