FROM : Jim Correia
DATE : Wed Jan 29 20:07:43 2003
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.
Jim
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Wed Jan 29 20:07:43 2003
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.
Jim
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.






Cocoa mail archive

