当您使用按钮右上角的按钮关闭iPad上的键盘时,不会调用方法textViewDidEndEditing
。但是,我希望调用该方法,以便我基本上可以访问书面文本。
任何建议?
答案 0 :(得分:1)
观察UIKeyboardDidHideNotification
:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidHide:)
name:UIKeyboardDidHideNotification
object:nil];
- (void)keyboardDidHide:(NSNotification *)note {
// Whatever you want
}
不要忘记在removeObserver:
中致电dealloc
:
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}