Been having my first crack at Core Data and I\'m getting the following error when running my code on my device, but it works fine on the simulator..
*
I had this problem out of nowhere after I deleted the generated app in the ~/Library/Application Support/iPhone Simulator
. Somehow this caused subsequent builds to fail in the simulator and on devices. Hadn't changed anything to do with CoreData for ages but it would fail with the Cannot create an NSPersistentStoreCoordinator with a nil model
. Tried a few things above and nothing worked.
I could see the generated momd folder with the mom file inside. The app in the simulator could see both but it failed to generate the sqlite file.
What solved it was adding an attribute to an entity in my xcdatamodeld file in Xcode and then immediately deleting it. I was hoping this would get Xcode to regenerate whatever was causing the issue from scratch and it seemed to work. Still not clear what was actually wrong, but my app is running in the simulator and devices again now.