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

Following documentation in Readme doesn't seem to setup core data correctly #55

Closed
aussiegeek opened this issue Jul 31, 2011 · 2 comments

Comments

@aussiegeek
Copy link

I followed the instructions in the readme, but get an exception "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Product'" as soon as I try and send createEntity.

A sample project is at https://github.com/aussiegeek/MagicalRecordTest

@casademora
Copy link
Member

So, I downloaded your project, it looks like you're not using one of the setup methods to initialize the core data stack:

[MagicalRecordHelpers setupCoreDataStack];

I put this method call before your call to createData, and the app worked.

I think there is a line in the docs that say that the Core Data stack should be created for you, but this doesn't seem to be the case.

Also, I recommend against cleaning up the stack on background or resign active because your app can potentially still be running, and using data from core data. Cleanup is for unit testing and application termination.

I hope this helps get you going, I'm going to have a more complete sample app in the project sometime soon (within the next month).

Cheers,

Saul

Saul Mora
saul@casademora.com (mailto:saul@casademora.com)
http://about.me/saulmora

On Sunday, July 31, 2011 at 6:21 AM, aussiegeek wrote:

I followed the instructions in the readme, but get an exception "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Product'" as soon as I try and send createEntity.

A sample project is at https://github.com/aussiegeek/MagicalRecordTest

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

@aussiegeek
Copy link
Author

Thanks Saul,

All up and running smoothly now.

Also noticed you had code to generate an NSFetchedResultsController, wow that is much simpler!

On 01/08/2011, at 1:51 AM, casademora wrote:

So, I downloaded your project, it looks like you're not using one of the setup methods to initialize the core data stack:

[MagicalRecordHelpers setupCoreDataStack];

I put this method call before your call to createData, and the app worked.

I think there is a line in the docs that say that the Core Data stack should be created for you, but this doesn't seem to be the case.

Also, I recommend against cleaning up the stack on background or resign active because your app can potentially still be running, and using data from core data. Cleanup is for unit testing and application termination.

I hope this helps get you going, I'm going to have a more complete sample app in the project sometime soon (within the next month).

Cheers,

Saul

Saul Mora
saul@casademora.com (mailto:saul@casademora.com)
http://about.me/saulmora

On Sunday, July 31, 2011 at 6:21 AM, aussiegeek wrote:

I followed the instructions in the readme, but get an exception "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Product'" as soon as I try and send createEntity.

A sample project is at https://github.com/aussiegeek/MagicalRecordTest

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

Reply to this email directly or view it on GitHub:
#55 (comment)

Alan Harper
0457 090 366
Skype: alanbharper

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