However, once I completed the tutorial to a point where I was able to build and run, the app was crashing and I was perplexed as to why. So I started with what the Debugger was telling me.
2009-07-13 13:08:48.605 Locations[57726:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
First I decided to add a trace to the method that creates the persistent store coordinator for the application:
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:nil error:&error]) { // Handle error NSLog(@"error %@, %@", error, [error userInfo]); }
I built the app once again and the error was printed quite nicely. The thing that caught my eye was: reason = "The model used to open the store is incompatible with the one used to create the store";
A quick look around the net yielded a few results which led me to look for the .sqlite file that the iPhone Simulator creates for the app ... and delete it.
Yes, it appears that when you are creating new entities in your Data Model (at least initially) and adding attributes and/or relationships, XCode doesn't agree with things. The solution is to simply delete the .sqlite file and build again. The only question at this point is: will this happen each time I add a new attribute or another entity?


