• 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: Copying Managed Objects from App to Doc MOContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying Managed Objects from App to Doc MOContext


  • Subject: Re: Copying Managed Objects from App to Doc MOContext
  • From: Ben Trumbull <email@hidden>
  • Date: Tue, 28 Jul 2009 18:03:20 -0700


On Jul 28, 2009, at 5:36 PM, Jerry Krinock wrote:


But for restoring previous state over an existing object, that's undesirable. There are other more complicated approaches, but ultimately handling NSNull in your restore code is the least bad approach.

In what practical situation would one want to be "restoring previous state over an existing object"?

Well, in your copy & paste code, what happens if the object already exists in the destination MOC ? Or, say, a paste operation occurs, some edits happen to the new object, and then the user pastes again ? For some applications, pasting should always create a new object, but for others, the value on the pasteboard includes an objectID. If the paste refers to a specific object, then that will be applied over existing edits. If the pasteboard does not represent nils (e.g. those keys are absent) then edited values won't be set to nil on the second paste operation.


ditto for undo/redo and similar tasks.

- Ben



_______________________________________________

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: 
 >Re: Copying Managed Objects from App to Doc MOContext (From: Jerry Krinock <email@hidden>)
 >Re: Copying Managed Objects from App to Doc MOContext (From: Ben Trumbull <email@hidden>)
 >Re: Copying Managed Objects from App to Doc MOContext (From: Jerry Krinock <email@hidden>)

  • Prev by Date: NSSplitView autosave troubles
  • Next by Date: Re: NSRulerView
  • Previous by thread: Re: Copying Managed Objects from App to Doc MOContext
  • Next by thread: Fun (or not) with NSArrayControllers and CoreData.
  • Index(es):
    • Date
    • Thread