iOS - NSNotificationCenter multiple UIKeyboard notification

随声附和 提交于 2019-12-06 07:38:52

I solved this problem changing the place in wich I register for the notification. To make sure that only the viewController visible is the controller that receive the notification I register for the notification in vieWillAppear and remove the notification in viewWillDisappear.

Your syntax is a bit messed too, you need to add the word selector after the @ ...

[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardDidAppear:)
                                                 name:UIKeyboardWillShowNotification
                                               object:self.view.window];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!