textField通知事件iOS

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

//设置通知
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector (textFieldChange:)
     name:UITextFieldTextDidChangeNotification object:_commentTextField];
//实现通知方法
- (void) textFieldChange:(NSNotification *)notification{
    UITextField *textField=[notification object];
}


/*****************************************************************************/
_textField = [[UITextField alloc]initWithFrame:CGRectMake(5, 10, SCREEN_WIDTH-10, 40)];
    [_textField addTarget:self action:@selector(textFieldDidChangee:) forControlEvents:UIControlEventEditingChanged];
//点击方法
- (void)textFieldDidChangee:(UITextField *)textField
{
    
    NSLog(@"333%@",textField);
    
}