Re: NSUndoManager implementing Redo
Re: NSUndoManager implementing Redo
- Subject: Re: NSUndoManager implementing Redo
- From: petite_abeille <email@hidden>
- Date: Fri, 12 Jul 2002 14:38:46 +0200
On Friday, July 12, 2002, at 02:14 , Greg Hulands wrote:
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
Ummm... I still don't get it :-( You mean you simply want to register
multiple action for an undo, eg:
[NSUndoManager beginUndoGrouping]
[NSUndoManager registerUndoWithTarget: bla selector: @bla object: bla]
[NSUndoManager registerUndoWithTarget: blaselector: @blabla object:
blabla]
[NSUndoManager endUndoGrouping]
Is it what you are talking about? One way, or the other,
registerUndoWithTarget has only one selector as there is no technical
differences between undo/redo...
On the other hand, if you are simply talking about adding object to an
array or something, why not simply follow this "convention"? Eg:
- (NSMutableArray) departements;
- (void) addToDepartements: (id) aValue
{
[NSUndoManager registerUndoWithTarget: self selector:
@removeFromDepartements object: aValue]
}
- (void) removeFromDepartements: (id) aValue
{
[NSUndoManager registerUndoWithTarget: self selector:
@addToDepartements object: aValue]
}
Cheers,
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.