[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFiledEditChanged:)
name:@"UITextFieldTextDidChangeNotification"
object:self.jobTextField];
- (void)textFiledEditChanged:(NSNotification *)obj {
UITextField *textField = (UITextField *)obj.object;
// 自己的业务逻辑
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
// textField 输入指定格式的信息 输入的字符
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string :(id)sender{
// return NO; textField 不改变
// return YES; textField 改变
}