Just in case someone made the same stupid mistake as I did:
Check out if the method name of what you expect of being didSelect
may accidentally be gotten didDeselect
in some way. It took about two hours for me to find out ...
If I understand correctly, the touchesEnded event is detected, but not by the subview that needs to know about it. I think this might work for you:
In a common file, define TOUCHES_ENDED_IN_SUPERVIEW as @"touches ended in superview".
In the touchesEnded method of the containing view that is firing, add
[[NSNotificationCenter defaultCenter] postNotificationName: TOUCHES_ENDED_IN_SUPERVIEW object: self];
In the touchesBegan of the subviews, add
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(touchesEnded:)
name: TOUCHES_ENDED_IN_SUPERVIEW
object: self.superview];
In the touchesEnded methods of the subviews, use your normal logic for the event, and also add
[[NSNotificationCenter defaultCenter] removeObserver: self name: TOUCHES_ENDED_IN_SUPERVIEW object: self.superview];
Remember to put [[NSNotificationCenter defaultCenter] removeObserver: self] in your dealloc as well, in case it is possible to leave the page without getting the touchesEnded event.
You might want the notification to send its message to a special touchesEndedInSuperview method, which would invoke touchesEnded itself, but that depends on whether you have any special processing to do in that case.
Best Answer
I suspect you got a call to
touchesCancelled:withEvent:
in those cases withouttouchesEnded:withEvent:
being called. Did you implement that method?