Re: NSUndoManager implementing Redo
Re: NSUndoManager implementing Redo
- Subject: Re: NSUndoManager implementing Redo
- From: Greg Hulands <email@hidden>
- Date: Fri, 12 Jul 2002 22:14:00 +1000
If you have a storage of objects that hold the data and you allow the user
to delete "records", you have to be able to reinsert them into the array and
reperform any checks.
So you have
- (void)createObject
{
register the undo method as undoCreateObject with object just created
}
- (void)undoCreateObject:(id)object
{
[myStorage removeObject:object];
register the undo for deleting as redoCreateObject with object
}
- (void)redoCreateObject:(id)object
{
//run checks on object
[myStorage addObject:object];
register the undo for reinsertion as undoCreateObject with object
}
Greg
On 12/7/02 9:31 PM, "petite_abeille" <email@hidden> allegedly made
the following allegations:
>
On Friday, July 12, 2002, at 12:29 , Bill Cheeseman wrote:
>
>
> Yes, you can specify different methods for undo and redo. In an object
>
> deletion scenario, you petty much have to do it this way. For example,
>
> to
>
> add an object to a table view, I use three methods:
>
>
Ummm... I'm a little bit confused about how one will go about doing such
>
a thing?!?!? Care to elaborate?
>
>
>
The NSUndoManager provides only one method:
>
>
- (void)registerUndoWithTarget:(id)target selector:(SEL)selector
>
object:(id)anObject;
>
>
There are no real difference between undu and redo. So, short of messing
>
around with beginUndoGrouping/endUndoGrouping and/or multiple
>
NSUndoManager, what are you talking about exactly?
>
>
Am I missing something obvious?
>
>
Thanks.
>
>
PA.
>
_______________________________________________
>
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.
_______________________________________________
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.