UITapGestureRecognizer导致应用程序时,刷卡完成崩溃。 舒瓦茨在很短的距离做不会引起任何问题,但那些在更长的距离做给错误:
-[UITapRecognizer name]: unrecognized selector sent to instance 0x17ee27c0
其中0x17ee27c0是随机值。
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITapRecognizer name]: unrecognized selector sent to instance 0x17ee27c0'
*** First throw call stack:
(0x2cb7dc1f 0x3a328c8b 0x2cb83039 0x2cb80f57 0x2cab2df8 0x2feee1c1 0x2d7d01cf 0x3024822d 0x300671ad 0x30066bcd 0x3003d3dd 0x302b0c29 0x3003be39 0x2cb44377 0x2cb43787 0x2cb41ded 0x2ca90211 0x2ca90023 0x33e890a9 0x3009c1d1 0xdca87 0x3a8a8aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException
UITapRecognizer *(0x17ee27c0)是tapGestureRecognizer._imp
这是发生在运行iOS 8.1的多个设备。 源被编译上的Xcode 6。
这里是我声明UITapGestureRecognizer:
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)];
[myView addGestureRecognizer:tapGestureRecognizer];
这里是方法:
- (void)viewTapped:(UITapGestureRecognizer *)sender { }
所述UITapGestureRecognizer放置在SKView;
这里是堆栈跟踪: http://imageshack.com/a/img903/3622/X9QFX0.png