陈斌彬的技术博客

Stay foolish,stay hungry

iOS监听textField变化

1.添加观察者

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldChanged:) name:UITextFieldTextDidChangeNotification object:nil];

2.实现监听方法

- (void)textFieldChanged:(NSNotification *)noti {
}