This issue really has me stumped...
I have an iPad project that I use UIPanGestureRecognizer and I am using the following method call within my handlePanGesture:
- (AIEnemyUnit *) hitTestForEnemyUnit:(CGPoint)where {
CALayer * layer = [self hitTest:where];
while (layer) {
if ([layer isKindOfClass:[AIEnemyUnit class]]) {
return (AIEnemyUnit *)layer;
} else {
layer = layer.superlayer;
}
}
return nil;
}
Once I "find" an AIEnemyUnit layer, I continue with the drag and everything works fine. Except about around the 6th to 10th "drag" I get a crash with the debugger deep within only the CALayer -hitTest:
modifying layer that is being finalized - 0x124530
*** -[NSCFSet hitTest:]: unrecognized selector sent to instance 0x124530
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason:
'*** -[NSCFSet hitTest:]: unrecognized selector sent to instance 0x124530'