I am trying to remove three gesture recognizers attached to a uiscrollview.
I list them with
NSArray * activeScrollViewGRecs = [theScrollView gestureRecognizers]; NSLog (@"activeScrollViewGRecs count: %d",[activeScrollViewGRecs count]);
I get the three listed.
Then I delete them with
for (UIGestureRecognizer *recognizer in activeScrollViewGRecs) { NSLog (@"recognizer: %@",recognizer.description); recognizer.enabled = NO; [theScrollView removeGestureRecognizer:recognizer]; }
Then I listed them again and get a zero number. They need to be removed / removed, right? Why then would the performance continue to react (and the gesture methods invoked) to the same touches / strokes. Is there some kind of flushing mechanism that must happen before they leave forever?
this is how they are created:
tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handle1:)]; tapGesture.cancelsTouchesInView = NO; tapGesture.delaysTouchesEnded = NO; tapGesture.numberOfTouchesRequired = 2; tapGesture.numberOfTapsRequired = 2; [self.view addGestureRecognizer:tapGesture]; [tapGesture release]; swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handle2:)]; swipeGesture.cancelsTouchesInView = NO; swipeGesture.delaysTouchesEnded = NO; swipeGesture.delegate = self; swipeGesture.direction = UISwipeGestureRecognizerDirectionLeft; [self.view addGestureRecognizer:swipeGesture]; [swipeGesture release];
thanks
source share