Core Data: Specifying latest .mom resource. Was: NSMigratePersistentStoresAutomaticallyOption...
Core Data: Specifying latest .mom resource. Was: NSMigratePersistentStoresAutomaticallyOption...
- Subject: Core Data: Specifying latest .mom resource. Was: NSMigratePersistentStoresAutomaticallyOption...
- From: Jerry Krinock <email@hidden>
- Date: Mon, 23 Nov 2009 22:55:43 -0800
Sorry, I'm back with this problem. Although the code I posted worked perfectly in a Debug build, when I tested a Release build, the invocation of -mergedModelFromBundles: raised this exception :
Can't merge models with two different entities named 'Ixternalizer_entity'
Apparently if you've got new and old version .mom files in a bundle, of course there are going to be conflicts, and it seems that in my Debug build Core Data has some way of figuring out which is the latest and merging them. But in my Release build it doesn't work.
So, instead of using -mergedModelFromBundles:, I got the bundle resource path, appended the hard-coded .momd path, appended the hard-coded name of the *latest* .mom file, created a URL, and then created PSC using -initWithContentsOfURL:
I'm not posting the code because it is disgusting. There must be a trick to tell Core Data to "just use the latest mom file". What is it?
Sincerely,
Jerry Krinock
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden