Re: More on Undo and Redo
Re: More on Undo and Redo
- Subject: Re: More on Undo and Redo
- From: Michael Ash <email@hidden>
- Date: Thu, 19 Feb 2009 22:29:17 -0500
On Thu, Feb 19, 2009 at 2:34 PM, Randall Meadows <email@hidden> wrote:
> The problem is Redo. This is not a symmetric operation, like changing the
> color of an object on screen. All I need to do to Redo is call the method
> that deletes the card. It seems I need to tell the Undo manager to invoke a
> different method, with different arguments, when Redo is invoked, but I've
> not found how to do that.
I'm afraid I don't understand the difficulty. In your delete method,
you set up an undo operation to call your add method. When undo is
invoked, it calls your add method. In there, you set up an undo
operation to call your delete method. When redo is invoked, your
delete method is invoked, and you go back to the start. There's no
need to do anything special to tell the undo manager to do something
different, because it happens at a completely different place in your
code.
Mike
_______________________________________________
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