Re: Core Data Lightweight Migration Woes
Re: Core Data Lightweight Migration Woes
- Subject: Re: Core Data Lightweight Migration Woes
- From: Quincey Morris <email@hidden>
- Date: Thu, 19 Aug 2010 17:50:53 -0700
On Aug 19, 2010, at 14:31, Brad Gibbs wrote:
> // create object for prototype model
> NSString *prototypePath = [[NSBundle mainBundle] pathForResource:@"IconConfig" ofType:@"mom"];
>
> if (prototypePath == nil) {
> prototypePath = [[NSBundle mainBundle] pathForResource:@"IconConfig" ofType:@"momd"];
> }
> NSLog(@"Prototype path is %@", prototypePath);
What is shown as the prototype path?
Note that there *is* (presumably) a resource called IconConfig.mom -- inside the IconConfig.momd directory -- which contains your current model. If your code is finding that, then it won't look for IconConfig.momd, and so the returned model will look (presumably) to Core Data as if there's only one version.
Have you tried reversing this test, so that it finds the momd resource first, and only looks for the mom resource if there's no momd?
Also, have you tried examining the results of NSMappingModel’s inferredMappingModelForSourceModel:destinationModel:error: method?
_______________________________________________
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