UIMenuController not working as expected, canPerformAction not getting fired
Asked Answered
T

1

3

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

EDIT:
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.

Translocate answered 4/6, 2012 at 9:55 Comment(0)
V
3

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.

Vertebral answered 23/1, 2013 at 2:48 Comment(1)
One should override canBecomeFirstResponder instead of doing this, as I tried both methods and this one didn't work for me while overriding canBecomeFirstResponder did work.Marketable

© 2022 - 2024 — McMap. All rights reserved.