I have an UITableView in my class with a custom UITableViewCell with an UIImageView inside.
I need to detect the touch on this UIImageView to handle a custom method(handleSingleTouch:)
and I need to call the -didSelectRowAtIndexPath when the cell is selected.
So i added a UIGestureRecognizer to my TableView in this way:
UIGestureRecognizer *GEST=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTouch:)];
[self.myTable addGestureRecognizer:GEST];
GEST.delegate=self;
[GEST release];
[GEST setCancelsTouchesInView:NO];
[GEST setDelaysTouchesEnded:NO];
There is the conflict:
every time the UIImageView is touched the tableview the GestureRecognizer start the method but also the didSelectRowAtIndexPath is called.
Someone know the way to call the gestureRecognizerMethod without call the didSelectRowAtIndexPath?
Try adding the gesture recognizer to the image rather than the table. See this answer https://stackoverflow.com/a/7760402