//为一个编辑框myField添加观察者,观察当编辑框文字改变时通知
//方法textChange是通知发生是要做的事情
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChange)
name:UITextFieldTextDidChangeNotification object:self.myField];
- (void)textChange{
NSlog(@"myField text has change");
}