in uiresponder ,
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
what's the difference between [event allTouches] and [touches allObject]?
in uiresponder ,
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
what's the difference between [event allTouches] and [touches allObject]?
To my understanding it is as follows:
[event allTouches]
returns all touches that are part of the event. Some of those touches might be meant for another UIResponder.
For instance you might click in two view at the same time and the responder associated with each view will get called with all the touches of the event.
[touches allObject]
only contains touches ment for this responder. And is thus in most cases what you are after.