禁止输入空格这问题简单
textField.text = [textField.text stringByReplacingOccurrencesOfString:@" " withString:@""];
事还没完,前面不是重点,重点是要加判断的