UIMenuControllerWillShowMenuNotification 的 NSNotifcation
我正在尝试监听 iphone sdk 3.0 中的 UIMenuController 通知。
但似乎我的通知永远无法被调用。这是我的代码:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillShow:) name:UIMenuControllerWillShowMenuNotification object:nil];
和我的方法
- (void)menuControllerWillShow:(NSNotification *)notification {
NSLog (@"Call here");
}
但它永远不会打印出“Call here”,断点也永远不会停止。有谁知道如何解决这个问题。
我知道 iphone sdk 4.0 的 setMenuItems 方法,但我正在为 sdk 3.0 工作。
我最初的问题是我试图捕获 UIMenuController 事件来显示按钮工具栏,例如:文本的“Do A”、“Do B”。如果有人知道这个问题的任何解决方案,我也很感激
I am trying to listen for UIMenuController Notification in iphone sdk 3.0 .
But it seems that my notification can never get called. Here is my code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillShow:) name:UIMenuControllerWillShowMenuNotification object:nil];
and my method
- (void)menuControllerWillShow:(NSNotification *)notification {
NSLog (@"Call here");
}
But it never prints out "Call here", breakpoint never gets stop as well. Does anyone know how to solve this problem.
I know the approach of setMenuItems for iphone sdk 4.0 but I am working for sdk 3.0.
My original problem is that I am trying to catch the UIMenuController event to show a toolbar of buttons like: "Do A", "Do B" for the text. If anybody knows any solution for this, I also appreciate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,有几个人也遇到了您的问题:
https://stackoverflow.com/questions/2959774/nsnotification-for-uimenucontrollerwillshowmenunotification
http://www.iphonedevsdk.com/forum/iphone-sdk-development/36198-uimenucontrollerwillshowmenunotification-not-working.html" iphonedevsdk.com/forum/iphone-sdk-development/36198-uimenucontrollerwillshowmenunotification-not-working.html
http://www.iphonedevsdk.com/forum/iphone-sdk-development/50605-uimenucontroller-wont-send-notification.html
最后一个很有趣。您遇到的这个问题似乎是 4.0 之前版本中的错误。我找不到任何关于是否有解决方案的信息。
Well, several people also had your problem:
https://stackoverflow.com/questions/2959774/nsnotification-for-uimenucontrollerwillshowmenunotification
http://www.iphonedevsdk.com/forum/iphone-sdk-development/36198-uimenucontrollerwillshowmenunotification-not-working.html
http://www.iphonedevsdk.com/forum/iphone-sdk-development/50605-uimenucontroller-wont-send-notification.html
The last one is interesting. This issue that you have appears to be a bug in pre-4.0. I couldn't find anything about whether there was a solution.