Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何找到未记录版本的HandleTesture选择器(适用于UIWebView)需要哪些类型的参数?_Iphone_Ios_Ipad_Uiwebview_Gestures - Fatal编程技术网

Iphone 如何找到未记录版本的HandleTesture选择器(适用于UIWebView)需要哪些类型的参数?

Iphone 如何找到未记录版本的HandleTesture选择器(适用于UIWebView)需要哪些类型的参数?,iphone,ios,ipad,uiwebview,gestures,Iphone,Ios,Ipad,Uiwebview,Gestures,我已将自定义弹出菜单添加到UIWebView实例: - (void)viewDidLoad { UILongPressGestureRecognizer* gesture = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture::)] autorelease]; } - (void)handleGesture { } - (void)handle

我已将自定义弹出菜单添加到UIWebView实例:

- (void)viewDidLoad
{
    UILongPressGestureRecognizer* gesture = [[[UILongPressGestureRecognizer alloc] 
    initWithTarget:self action:@selector(handleGesture::)] autorelease];
}

- (void)handleGesture
{

}

- (void)handleGesture:(UIGestureRecognizer*)gestureRecognizer
{
    if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
        [gestureRecognizer.view becomeFirstResponder];
        UIMenuController* mc = [UIMenuController sharedMenuController];
        [mc setTargetRect: gestureRecognizer.view.frame inView: gestureRecognizer.view.superview];
        [mc setMenuVisible: YES animated: YES];
}
而且它有效!直到我将textarea(CodeMirror编辑器)聚焦到网页上。在这种情况下,我有以下例外:

-[FirstViewController handleGesture::]: unrecognized selector sent to instance 0x20369c00
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FirstViewController handleGesture::]: unrecognized selector sent to instance 0x20369c00'
*** First throw call stack:
(0x3608c2a3 0x3439c97f 0x3608fe07 0x3608e531 0x35fe5f68 0x3747ad31 0x374423dd 0x3762f479 0x37366837 0x3736529b 0x360616cd 0x3605f9c1 0x3605fd17 0x35fd2ebd 0x35fd2d49 0x3650f2eb 0x373b1301 0x140bb 0x14060)
libc++abi.dylib: terminate called throwing an exception
(lldb) 
我认为需要实现带有外来参数的HandleTesture选择器的无文档版本。是这样吗?如何找到所需的参数类型?

正确的代码:

initWithTarget:self action:@selector(handleGesture:)] autorelease];

我希望您没有打算将此提交到应用商店。使用未记录的API是立即拒绝的理由:“2.5使用非公共API的应用将被拒绝”,但这是你的应用。如果你想抓住机会,希望他们不会注意到,那是你的权利。我只是想确保当你被拒绝时你不会感到惊讶。