I am using iPhone SDK 3.0.
Say I turned on 'shake to undo' by setting application.applicationSupportsShakeToEdit to YES in my application delta. I created a UITextView in the RootViewController and became the first responder when I started the application.
I use - (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text to make changes to the text representation according to what the user enters. The problem is that he confused the default undo action. Shaking the device no longer displays "Cancel Entry."
I tried to create a cancellation manager, but have not had time yet. Nothing appears when I shake my device, although I had a cancel manager that logged some prepareWithInvocationTarget action.
Does anyone have an idea?
EDIT . I checked WriteRoom for iPhone behavior, as well as the sample code for the TextExpander Touch SDK sample code, both of which display the Undo option when shaking until they complete automatically. That is, when a change is carried forward to textView via setText :, I think. Thus, changing the contents of a textView does affect the undo mechanism.
EDIT 2 : The question is: how could I enable the undo function in this case?
source share