my NSManagedObjectModel is returning nil eventhough the path is correct.
NSString *modelKey = [NSString stringWithFormat:@\"/%@/Model\", name];
N
I just encountered this issue after changing the case of the name of the .xcdatamodeld file (e.g. refactored "mydatastore.xcdatamodeld" to "MyDatastore.xcdatamodeld") on a case-insensitive filesystem.
The fix includes both of the above answers:
Refactor the data model file to a distinctly different name, e.g. "MyDatastoreTemporary.xcdatamodeld"
Product > Clean
Close XCode. Re-open XCode and the project.
Refactor the data model file back to its final name, e.g. "MyDatastore.xcdatamodeld"
Product > Clean
Close XCode. Re-open XCode and the project.