//第1种方法 view: 控制器的view
[self.view endEditing:YES];
//第2种方法
[[UIApplication sharedApplication]sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
//第3种方法
[[[UIApplication sharedApplication]keyWindow]endEditing:YES];
//第1种方法 view: 控制器的view
[self.view endEditing:YES];
//第2种方法
[[UIApplication sharedApplication]sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
//第3种方法
[[[UIApplication sharedApplication]keyWindow]endEditing:YES];