UIMenuController没有按预期工作,canPerformAction没有被触发 [英] UIMenuController not working as expected, canPerformAction not getting fired
问题描述
我最近遇到了一个问题。 UITapgesture在模拟器上工作非常完美,甚至可以在设备上直接调试(iPhone 4,iOS 5.0.1),但是当我打包应用程序(Dep_Target iOS4.0m Base_SDK iOS5.1(最新版))进行adhoc发布并将其发送到客户端时手势不起作用。然后我通过测试飞行在我用于调试的同一设备上安装了构建,手势不起作用。我重新检查了一切,我使用相同的版本进行分发。
任何帮助将不胜感激。谢谢
I ran into a problem lately. The UITapgesture working on simulator perfect and even while debugging directly on the device (iPhone 4, iOS 5.0.1) but when I package the app (Dep_Target iOS4.0m Base_SDK iOS5.1(latest)) for adhoc distribution and send it to client the gestures doesn't work. I then installed the build via test flight on the same device which I am using for debugging, the gesture doesn't work on it. I rechecked everything, I am using same build for distribution. Any help will be much appreciated. Thanks
编辑:
经过一些调试后发现UITapgesture不是罪魁祸首。手势方法被解雇但我在手势中使用了UIMenuController。菜单控制器被实例化,但在视图中不显示。除了方法:
after doing a bit debugging it turns out that UITapgesture is not the culprit. The gesture method is getting fired but I've used a UIMenuController inside the gesture. The menu controller gets instantiated and all but not gets displayed on view. Besides the method:
- (BOOL) canPerformAction:(SEL)selector withSender:(id) sender
也没有被解雇。请记住这一切都发生在通过测试飞行分发的构建中,否则一切都运行完美。
is not getting fired too. Do remember this all is happening in the build which is distributed via test flight, otherwise everything runs perfect.
推荐答案
我得到了这个在我的一个应用程序中发出问题并在函数的第一行写入 [self becomeFirstResponder]
(在行<$ c $之前) c> [[UIMenuController alloc] init] )解决了我的问题。
I was getting this issue in one of my application and writing [self becomeFirstResponder]
at the very first line in the function (i.e. before the line [[UIMenuController alloc] init]
) solved my problem.
这篇关于UIMenuController没有按预期工作,canPerformAction没有被触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!