UITapGestureRecognizer causes app to crash when a swipe is done. Swipes done over very short distances do not cause any problems, but those done over a longer distance give the error :
-[UITapRecognizer name]: unrecognized selector sent to instance 0x17ee27c0
where 0x17ee27c0 is a random value.
*** 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) is from tapGestureRecognizer._imp
This is happening on multiple devices running iOS 8.1 . The source is compiled on Xcode 6.
Here is how I declare the UITapGestureRecognizer:
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)];
[myView addGestureRecognizer:tapGestureRecognizer];
And here is the method:
- (void)viewTapped:(UITapGestureRecognizer *)sender { }
The UITapGestureRecognizer is placed on a SKView;
Here is the stack trace: http://imageshack.com/a/img903/3622/X9QFX0.png