标签:class tar ext string har file
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;
{
NSString * toBeString = [textField.text stringByReplacingCharactersInRange:range withString:string];
UITextField *loginPass = _textArr[1];
if (loginPass == textField) {
if ([toBeString length] > 12) {
textField.text = [toBeString substringToIndex:12];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"长度不能超过12" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
[alert show];
return NO;
}
}
return YES;
}
UItexfile实时验证输入字符,布布扣,bubuko.com
标签:class tar ext string har file
原文地址:http://blog.csdn.net/alincexiaohao/article/details/30482387