cocoa touch - Trap backspace key on the iPhone -


On the iPhone, I tried to find a way to trap the backspace key pressed and to work. But there is no way to do it !! Is there definitely a document documented in SDK?

/ John

The input that is taking to your UITextField, your controller Set the object to be a representative of the text field and

  - (BOOL) textfield: (UITextField *) textField shouldChangeCharactersInRange: Apply the (NSRange) range Replacement string: (NSString *) string < / Code> 

Representative method in your controller.

This method should be called for each editing event (keypress). I believe that you should be able to see the blank replacement string to indicate that the letters are being removed by the backspace key.


Comments