Migrating this blog post from my old blog. This might help if some one gets stuck with this "NSInternalInconsistencyException".
If you see the following exception while working with core data (iphone sdk):
[Session started at 2010-06-01 22:47:09 -0700.]
2010-06-01 22:47:11.150 MyCoreDataList[88744:20b] *** Terminating app due to uncaught exception ' NSInternalInconsistencyExcepti on', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Stock''
2010-06-01 22:47:11.153 MyCoreDataList[88744:20b] Stack: (
9905243,
2444394043,
7893163,
...
Place the following segment in your RootViewController's ViewDidLoad() method
if(managedObjectContext == nil){
managedObjectContext = [(MyCoreDataListAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
}
No comments:
Post a Comment