Re: Bindings and Undoing changes
Re: Bindings and Undoing changes
- Subject: Re: Bindings and Undoing changes
- From: Sarat Kongara <email@hidden>
- Date: Fri, 17 Jun 2005 22:34:41 -0700
Hi Scott,
Thanks for the suggestion. I am not using CoreData for my application.
In the method that starts the edit sheet I am doing this
[[windowController undoManager] beginUndoGrouping];
and in the Save method I am doing this
[[windowController undoManager] endUndoGrouping];
and in the Cancel method I am doing this
[[windowController undoManager] endUndoGrouping];
if([[windowController undoManager] canUndo]) {
[[windowController undoManager] undo];
}
I am not sure if this is a clean way to handle it. Seems to work for
now. I will think about you suggestion of maintaining a duplicate set.
Thanks again. BTW I really like your blog entry on Core Data.
Regards
Sarat
On 6/16/05, Scott Stevenson <email@hidden> wrote:
>
>
> On Jun 16, 2005, at 11:57 AM, Sarat Kongara wrote:
>
>
> I have a master-detail interface, the main window has a table view
>
> (master interface) and double clicking each row in the tabel view
>
> opens a new sheet for editing the model object attributes (detail
>
> view). The sheet has two buttons "Cancel" and "Save". All the UI
>
> elements in the detail view are using bindings. I am not sure how to
>
> handle the Cancel functionality in the sheet, How can I undo the
>
> changes when the user selects the "Cancel" button, it could be
>
> multiple undos depending on how many fields in the sheet the user
>
> changed. Should I create a new Undo Group?
> You should create a duplicate set of model objects, and only copy the
> changes back to the main model if the user hits "Save". Core Data can do
> much of this automatically.
>
>
>
> - Scott
>
>
>
>
>
> --
>
> http://theocacao.com/
>
> feed://theocacao.com/index.rss
>
>
> _______________________________________________
> 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
>
>
_______________________________________________
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