解决UITextField输入到最大值不能删除的现象
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
BOOL isAllowEdit = YES;
if([string length]>range.length&&[textField.text length]+[string length]-range.length>_NAME_MAX_LENGTH_)
{
[textField resignFirstResponder];
isAllowEdit = NO;
}
return isAllowEdit;
}