UItextField 中去除输入的前后空格
1.在结束编辑时去除
- (void)textFieldDidEndEditing:(UITextField *)textField{
NSString *temp = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
textField.text = temp;
}
2.- (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
NSString *temp = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSetwhitespaceCharacterSet]];
textField.text = temp;
}