- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if ([str isEqualToString:@""]) // 判断删除操作
{
return YES;
}
else if (textField.text.length == 12) // 输入文字大于12位禁止输入
{
return NO;
}
return YES;
}
网友评论