(1)在 ViewController.h 中声明一个方法:
- (IBAction)textFiledReturnEditing:(id)sender;
(2)在 ViewController.m 中实现这个方法:
-(IBAction)textFiledReturnEditing:(id)sender {
[sender resignFirstResponder];
}
(3)让文本框映射到 textFiledReturnEditing 方法,此时的事件应当是 Did End On Exit