In my iPad app. I have one UITextField. User would enter some value in that text field. This value has to be Alpha Numeric. I want to show an alert to the user if he/she enters any special character.
How can I do it? What should be the condition for alert?
Any help would be highly appreciated.
Thanks and regards,
PC
Implement
textField:shouldChangeCharactersInRange:replacementString:in the delegate, check the replacement string for special characters, and disallow the replacement if you detect any.The easiest way to check for non-alphanumerics is as follows: