| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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.
| References: | |
| >Can't implement redo (From: Jeremy Dronfield <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.