Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRASH] Both test apps crash on startup in NSPersistentStoreCoordinator #24

Open
danieltiger opened this issue Sep 25, 2011 · 2 comments

Comments

@danieltiger
Copy link
Owner

This is on my laptop, I don't know if I have the same problem at work but I get the following error when I try and run either test app:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'

I traced it back to:

NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"PilotTestApp" withExtension:@"momd"];
__managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];

modelURL is nil for some reason. I tried changing that code to the more accepted:

[NSManagedObjectModel mergedModelFromBundles:nil];

Which solved the nil problem but then it crashed because it couldn't find an entity named redObject.

@Drewsmits
Copy link
Collaborator

Are you on 4.2 and 5.0? Could be that the model isn't being shared properly between apps, or something.

//as

On Sep 25, 2011, at 1:59 PM, Arik [email protected] wrote:

This is on my laptop, I don't know if I have the same problem at work but I get the following error when I try and run either test app:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'

I traced it back to:

NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"PilotTestApp" withExtension:@"momd"];
__managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];

modelURL is nil for some reason. I tried changing that code to the more accepted:

[NSManagedObjectModel mergedModelFromBundles:nil];

Which solved the nil problem but then it crashed because it couldn't find an entity named redObject.

Reply to this email directly or view it on GitHub:
#24

@danieltiger
Copy link
Owner Author

I'm on 5.0. I'm pretty sure they aren't being shared properly. Cause I can get one to work but not both.

Drewsmits added a commit that referenced this issue Nov 4, 2011
…eltiger, not sure if this will fix the crash or not, I can repro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants