I’m trying to receive notification when the keyboard appears but I’m in a situation where I have 2 UITextViews and need to be able to differentiate between them. For some reason, I can’t figure out how to filter this using the object parameter of “addObserver”. I’ve got something like this:
UITextView* w = mSubview.mText;
NSNotificationCenter* dnc = [NSNotificationCenter defaultCenter];
[dnc addObserver:self selector:@selector(showNotesKeyboard:) name:UIKeyboardWillShowNotification object:w ];
Whenever I specify w I don’t enter showNotesKeyboard. Only when I pass in nil does the notification actually get picked up. There must be something I’m missing here, please help me out.
Thanks!
Can you add an observer to when the text view starts editing instead? Editing will show keyboard.