ios – – [id gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer]两个识别器在调试器中都是零

我有一个方法

- (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>)>>
    }>

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

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

发生了什么?我可以以某种方式修复它吗?

最佳答案 这是XCode / lldb的一个已知错误,尚未解决.如果你没有运行xcode 5-dp,你可以回到gdb,它应该工作.

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

我的参考:Debugger lldb says my object is nil when is not ?

点赞