Cannot create an NSPersistentStoreCoordinator with a nil model

I had exactly the same error message as the original post. I was wrestling with this for hours.
It was this line in my AppDelegate.m.

NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"[same with name of xcdatamodeld]" withExtension:@"momd"];

For anyone out there searching this error message and finding this thread….try this first.

You must make sure that where it says [same with name of xcdatamodeld]….that it is!!!
For some reason, mine had my project name in there and not the data model name.

Changed it and it worked straight away…..

Thanks to Rock & Muller for contributing…….you saved me days!!

Gaz.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)