"Restrict length for UITextField"

Wed 29 September 2010

- (BOOL)textField:(UITextField )textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString )strin{

//Check that response is should be maximum 5 characters

if ([strin length] > 0) {

return [textField.text  length] < 5;

}

return YES;

}