• 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: Copy managed object between contexts?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy managed object between contexts?


  • Subject: Re: Copy managed object between contexts?
  • From: Colin Cornaby <email@hidden>
  • Date: Sun, 14 Aug 2005 22:10:46 -0700

Of course. The object is relationship free, and not in any committed relationships with any other objects, so this shouldn't be a problem. :)

On Aug 13, 2005, at 6:19 PM, Chris Hanson wrote:

On Aug 13, 2005, at 5:40 PM, Jim Correia wrote:


It is left as an exercise to the reader to do the same for relationships.


I would be extremely careful about "copying" relationships from one managed object to another. Sometimes a relationship represents association and other times a relationship represents containment.


For example, if instance A is associated with instance B via a to- one relationship with a to-one inverse relationship, instance CopyA *cannot* also be associated with instance B. In such a case, you probably won't want to try and copy the relationship at all.

On the other hand, if instance A "contains" instance B, you might want to make instance CopyA "contain" instance CopyB.

For this reason I'd recommend against writing "generic" code to "copy" relationships, and instead code carefully to be sure you get exactly what you want in each specific situation.

  -- Chris



--------------------------- Colin Cornaby Lead Programmer, ProToys Macintosh Specialist - University of Portland - htttp://up.edu

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Copy managed object between contexts? (From: Colin Cornaby <email@hidden>)
 >Re: Copy managed object between contexts? (From: mmalcolm crawford <email@hidden>)
 >Re: Copy managed object between contexts? (From: Colin Cornaby <email@hidden>)
 >Re: Copy managed object between contexts? (From: mmalcolm crawford <email@hidden>)
 >Re: Copy managed object between contexts? (From: Colin Cornaby <email@hidden>)
 >Re: Copy managed object between contexts? (From: Jim Correia <email@hidden>)
 >Re: Copy managed object between contexts? (From: Chris Hanson <email@hidden>)

  • Prev by Date: Core Data: slow saves to persistent store
  • Next by Date: Re: [Cocoadev] Problem becoming a good citizen and backwards compatible
  • Previous by thread: Re: Copy managed object between contexts?
  • Next by thread: NSStepper, NSDatePicker
  • Index(es):
    • Date
    • Thread