• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Merging changes across NSManagedObjectContexts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merging changes across NSManagedObjectContexts


  • Subject: Re: Merging changes across NSManagedObjectContexts
  • From: mmalc Crawford <email@hidden>
  • Date: Wed, 30 Dec 2009 18:11:08 -0800

On Dec 30, 2009, at 2:08 pm, Mike Abdullah wrote:

> It's pretty much the same as any other operation on with a MOC. You cannot copy or move a managed object from one MOC to another in a simple fashion. Instead, you have got to create new, corresponding objects in the second MOC, and then (if needed) delete the old objects from the first MOC.
>
Given the introductory clause ("It's pretty much the same as any other operation on with a MOC"), this is potentially misleading.  This applies to the specific case where you want to move data from one store to another.
For "typical operations with a context", you don't want to move records between stores. If you're using multiple contexts, the more likely scenario is that you have a realisation of a given record in one context and you want another realisation of the same record in another context.  For that you do not *create* new objects in the second context (and you don't *delete* the old objects in the first context); instead you ask the context for a managed object using objectWithID: or similar.

mmalc

_______________________________________________

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

References: 
 >Merging changes across NSManagedObjectContexts (From: Rick Mann <email@hidden>)
 >Re: Merging changes across NSManagedObjectContexts (From: mmalc Crawford <email@hidden>)
 >Re: Merging changes across NSManagedObjectContexts (From: Rick Mann <email@hidden>)
 >Re: Merging changes across NSManagedObjectContexts (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Save MyDocument
  • Next by Date: Re: Knowing mouse pressed time?
  • Previous by thread: Re: Merging changes across NSManagedObjectContexts
  • Next by thread: AddressBook ABMultiValue -labelAtIndex:
  • Index(es):
    • Date
    • Thread