views:

222

answers:

1

Hi,

I want to allow user to enter only english alphabets and characters. How can i prevent user from entering other characters than english.

Thanks,
Jim.

+1  A: 

Check out UIKeyboardType - there is an option to support only ASCII (UIKeyboardTypeASCIICapable).

Also, there are options in the UITextFieldDelegate protocol that could allow you to selectively filter input. Take a look at:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;

xyzzycoder