Re: Action based undo or snapshot based undo?
Re: Action based undo or snapshot based undo?
- Subject: Re: Action based undo or snapshot based undo?
- From: Greg Titus <email@hidden>
- Date: Wed, 29 Jan 2003 12:03:50 -0800
Oh good, then I completely second Bill's recommendation, then. I just
haven't read his book, so I took Alex's word for what it says...
- Greg
On Wednesday, January 29, 2003, at 11:07 AM, Jim Correia wrote:
On Wednesday, January 29, 2003, at 12:37 PM, Greg Titus wrote:
On Tuesday, January 28, 2003, at 11:32 PM, Alexander Lamb wrote:
As I understood, the NSUndoManager is based on the idea of recording
a series of actions needed if the user wants to undo what he just >>
did.
In Bill Cheeseman's book, he recommands recording those actions in
the action methods rather than at the object level, because it
reflects more closely what the user is doing and allows to customize
the undo for an action that may involve several changes on objects
attributes.
I totally disagree with Bill here (sorry Bill), and I think that that
is why you are running into problems.
You should register the changes at the object level, but you should
set the action name in the action methods.
I've read Bill's book, but don't have it handy to verify this. It is
my recollection that he recommends exactly what you do Greg - undo at
the model level and set the action name in the action methods.
You can grab the sample code for the book here
<http://www.stepwise.com/articles/VermontRecipes/>
which implements undo in that manner.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.