Re: Copying Managed Objects from App to Doc MOContext
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