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];
}
精彩评论