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 <je...@ieee.org> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to