Re: Cancelling changes on managed objects
Re: Cancelling changes on managed objects
- Subject: Re: Cancelling changes on managed objects
- From: Eric MORAND <email@hidden>
- Date: Sun, 24 Jun 2007 09:14:27 +0200
Great !
Thanks for the input, that's exactly what I need.
Eric.
Le 23 juin 07 à 14:59, mmalc Crawford a écrit :
On Jun 23, 2007, at 1:23 AM, Eric MORAND wrote:
Is there a simple way to cancel all changes made on a managed
object ? Let's say my user modify a managed object and then click
on a "cancel" button that is supposed to revert the object to its
original state. How am I supposed to implement such a (very
common) feature ?
The managed object context is a "scratch pad".
You can create a new context, fetch the relevant managed object
into it, and constrain the edits to that. You can then discard the
edits and the context if you want, otherwise merge them into the
main context -- see <http://developer.apple.com/documentation/Cocoa/
Conceptual/NSPersistentDocumentTutorial/08_CreationSheet/
chapter_9_section_1.html> for the general principles.
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