This seems to be a problem with the tab (\t
) character. This character is not handled like normal characters (e.g. a, b, c, 0, 1, 2, ...) and thus the
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string;
delegate method won't ever be called.
The result of using a tab on e.g. an external keyboard or in the simulator is that a currently active textfield resigns it's first responder status and the result of
[textField nextResponder]
will become first responder instead.
What IMO currently is a bug (iOS SDK 4.3) is that the delegate method
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
is only called once (when you return yes) and when you reselect the same textfield and use the tab key again, the method won't be called again.