アプリ画面のテキストフィールドをクリックしてキーボードが表示されると、xcodeデバッガーに次のエラーが表示されます。
[mainViewController keyboardWasShown]: unrecognized selector sent to instance 0x5867ac0
mainViewControllerのviewDidLoadメソッドで、次のようなregisterForKeyboardNotificationsメソッドを呼び出しています。
[自己registerForKeyboardNotifications];
(mainViewController.mでの)実装は次のとおりです。
- (void)registerForKeyboardNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotification object:nil];
}
// Called when the UIKeyboardDidShowNotification is sent.
- (void)keyboardWasShown:(NSNotification*)aNotification
{
}
// Called when the UIKeyboardWillHideNotification is sent
- (void)keyboardWillBeHidden:(NSNotification*)aNotification
{
}
何が間違っている可能性がありますか?