Can't implement redo
Can't implement redo
- Subject: Can't implement redo
- From: Jeremy Dronfield <email@hidden>
- Date: Tue, 30 Jul 2002 22:33:11 +0100
Can someone explain to me why I can't get a redo? I have an action
method which clears all the text from a TextView:
- (IBAction)clearNote:(id)sender
{
NSString *currentString = [NSString stringWithString:[textView
string]];
[[[self undoManager] prepareWithInvocationTarget:textView]
setString:currentString];
[textView setString:@""];
[[self undoManager] setActionName:@"Clear Note"];
}
The undo works, restoring the cleared text, but redo doesn't clear it
again. Is it because undo and redo are using the same value
(currentString) when they invoke the -setString: method? If so, isn't
that a bit stupid? The documentation gives the impression that performed
undos are, as it were, turned upside down and passed over to the redo
stack, but apparently not. How do I get around it?
-Jeremy
=======================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
_______________________________________________
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.