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 the same issue, i.e.
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MyModel" withExtension:@"momd"];
returned nil, because there was no .momd file generated.
The reason was that in the app directory (e.g. MyGreatApp/MyGreatApp.app) xcode had copied the MyModel.xcdatamodeld instead of generating the MyModel.momd from the MyModel.xcdatamodeld file (using momc).
The solution was to delete the reference to MyModel.xcdatamodeld inside the XCode project browser and drag it back into the project from the finder. After that xcode realized it needed to compile it to a .momd.