Re: Core Data : Managed Object Models : Configurations, Versions
Re: Core Data : Managed Object Models : Configurations, Versions
- Subject: Re: Core Data : Managed Object Models : Configurations, Versions
- From: Jack Nutting <email@hidden>
- Date: Wed, 16 Jun 2010 11:54:39 +0200
I can't answer all your questions off the top of my head, but:
On Wed, Jun 16, 2010 at 12:40 AM, Jerry Krinock <email@hidden> wrote:
> Apparently it is common to "merge" managed object models. When is this done?
>
> My app's bundle contains three managed object models, but they are for versioning; a current version and two older versions. When I create an in-memory store for temporary manipulation, following that Xcode template code I create a managed object model using [NSManagedObjectModel mergedModelFromBundles:nil].
>
You asked when the merging is done: That's the spot! The
mergedModelFromBundles: method creates a big combined model out of all
the models your app contains.
> Eeek. Is this merging my old and current model versions?
>
> If so, why doesn't that give me "Can't merge models with same entities" errors?
It's not merging your old and current model versions, because (I
assume) you've done the appropriate hand-waving to tell Xcode to deal
with your versioned model, giving you all those nice migration
features etc. At run-time, CD is smart enough to just grab the latest
version of each model it finds.
(The exception to that is if you've built with an unversioned model,
then told Xcode to add versioning to the model, and then built again
without first cleaning; Your old, unversioned model will still be
there in the bundle, and will conflict with the versioned model)
--
// jack
// http://nuthole.com
// http://learncocoa.org
_______________________________________________
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