开发者

UITextView didEndEditing isn't called on iPad

The method textViewDidEndEditing is not called when you dismiss the keyboard on the iPad with the button in the right corner at the button. However, i want the met开发者_运维技巧hod to be called so that I basically can access the written text.

Any Advice?


Observe UIKeyboardDidHideNotification:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(keyboardDidHide:) 
                                             name:UIKeyboardDidHideNotification 
                                           object:nil];

- (void)keyboardDidHide:(NSNotification *)note {
    // Whatever you want
}

Don't forget to call removeObserver: in dealloc:

- (void)dealloc {
  [[NSNotificationCenter defaultCenter] removeObserver:self];
  [super dealloc];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜