Re: Safely cancelling modifications
Re: Safely cancelling modifications
- Subject: Re: Safely cancelling modifications
- From: "R. Matthew Emerson" <email@hidden>
- Date: Thu, 23 Nov 2006 10:42:36 -0500
On Nov 23, 2006, at 3:03 AM, Eric Morand wrote:
I have an editor window, with a 'OK' button and a 'Cancel' button
(just like the iTunes one). The text fields in the window are bound
to the managed object attributes. So, when the user changes a value
in a field, the managed object is automatically modified with the
entered value.
What I want is to allow the user to cancel every modification done
since the editor window has been opened when he clicks on Cancel.
You could use a separate managed object context for the editor
window. When you show the window, create a managed object in the
local context and fill in its attributes. If the user clicks OK,
copy back the attributes to the "real" object in the main context.
Otherwise, you just ignore the edits made in the local context and
send it a reset message.
See the Department and Employees 2 example over at http://
homepage.mac.com/mmalc/CocoaExamples/controllers.html.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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