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

This is an Xcode error I was getting that took me a little while to figure out — my application would simply die when starting up with no other clues as to what was happening. I have been running through some tutorials on setting up CoreData for an iPhone app I’m working on, and I’ve been jumping between my laptop and desktop at various points, sharing the same project code between them. Turns out that you can’t just change the data model configuration in Xcode and re-run your application (my database had changed between working environments).  You can either version and migrate to your updated data model (which is what you would do in a production app, but gets a bit complicated), or in development, you can simply delete your existing database and have the compiler recreate it.

It was easy enough to figure out the problem through a little Googling, but it took me a while to discover how to actually solve it, at least running on the iPhone simulator. Of course, it makes sense once you figure it out… all you have to do is delete the app from the simulator, the same exact way you delete apps off of a physical iPhone — click and hold the icon until it switches into jiggling edit mode, then click the X button to delete it. So simple, yet maybe not so obvious.  You would logically think that this is something Xcode would do for you, or at least give you the option.

After doing that I was able to simply recompile and run my project with no problem. I like Objective-C so far, but the errors you have to figure out while working through the learning cycle have often been a bit more cryptic than I’m used to from other environments…

EDIT: Well, it seems that another error, Can’t find model for source store, is also solved by the same method of deleting the app from the simulator. I have no idea what caused it though… :?

Filed under: Xcode, iPhone | Comments: Comments Off

Comments are closed.