キーボードがいつ表示されるかを以下のコードで検出します。ただし、pushViewControllerを使用して別の画面にプッシュし、その画面でキーボードを開くと、keyboardWillShowが呼び出されます。これは本当に正しいですか?
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
// register for keyboard notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification
object:nil];