iOS 8.3 键盘通知不工作

iOS 8.3 Keyboard notification not working

这是我的键盘通知代码 written.The 以下代码适用于 iOS 8.1 SDK.But keyboardWasShown: 和 keyboardWillBeHidden: 的通知未在 [=17 中收到=] 8.3 device.Is iOS 8.3 sdk 有问题吗?

- (void)registerForKeyboardNotifications {

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWasShown:)
                                                 name:UIKeyboardWillShowNotification object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillBeHidden:)
                                                 name:UIKeyboardWillHideNotification object:nil];

}

- (void)keyboardWasShown:(NSNotification*)aNotification {
}


- (void)keyboardWillBeHidden:(NSNotification*)aNotification{
}

在 8.4 中检查过,它工作正常,只需检查是否调用了 registerForKeyboardNotifications 方法

问题出在 iOS 8.3 中的键盘上。从键盘设置中取消选中预测和拆分键盘,通知工作正常。