4

我有一个方法

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    NSLog(@"%@\n%@", gestureRecognizer, otherGestureRecognizer);
    return YES;
}

记录正常:

2013-04-12 21:36:20.126 Project[2504:907] <UITapGestureRecognizer: 0x1e5c25b0; state = Ended; view = <UIView 0x1e5c5cc0>; target= <(action=toggleControls, target=<PictureViewController 0x1e5c0ab0>)>; must-fail-for = {
        <UIScrollViewPanGestureRecognizer: 0x1e5c53a0; state = Failed; delaysTouchesEnded = NO; view = <ZoomScroll 0x1e5c4790>; target= <(action=handlePan:, target=<ZoomScroll 0x1e5c4790>)>>,
        <UIScrollViewPinchGestureRecognizer: 0x1e5c5bb0; state = Failed; delaysTouchesEnded = NO; view = <ZoomScroll 0x1e5c4790>; target= <(action=handlePinch:, target=<ZoomScroll 0x1e5c4790>)>>
    }>
<UIScrollViewPagingSwipeGestureRecognizer: 0x1f0bb4f0; state = Failed; view = <UIScrollView 0x1f0bb010>; target= <(action=_handleSwipe:, target=<UIScrollView 0x1f0bb010>)>; must-fail-for = {
        <UIScrollViewPanGestureRecognizer: 0x1f0bb340; state = Failed; delaysTouchesEnded = NO; view = <UIScrollView 0x1f0bb010>; target= <(action=handlePan:, target=<UIScrollView 0x1f0bb010>)>>
    }>

nil但在调试控制台中,它们都是

(lldb) po gestureRecognizer
$1 = 0x00000000 <nil>
(lldb) po otherGestureRecognizer
$2 = 0x00000000 <nil>

发生了什么?我能以某种方式解决这个问题吗?

4

2 回答 2

3

这是 XCode / lldb 的一个已知错误,尚未解决。如果您没有运行 xcode 5-dp,您可以返回 gdb,它应该可以工作。

Xcode 4.3 发行说明:“使用 LLDB 调试器时,断点中的某些调试器命令和日志表达式会失败,因为 Xcode 在执行调试器命令或评估日志表达式时使用了错误的帧。如果您知道调试器命令或日志表达式必须使用哪个线程相对于运行,添加一个断点动作,在有问题的断点动作之前将当前帧设置为适当的帧。10426977"

我的参考:调试器 lldb 说我的对象是 nil 什么时候不是?

于 2013-08-09T17:27:54.380 回答
-1

你初始化你的识别器了吗?

UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panView:)];
[panRecognizer setMinimumNumberOfTouches:1];
[panRecognizer setMaximumNumberOfTouches:1];
panRecognizer.delegate = self;
[self.webView addGestureRecognizer:panRecognizer];
于 2013-04-12T17:49:00.430 回答