, когда я пытаюсь выяснить, как бороться с касаниями в iOS, я видел, что какой-то код использует первый параметр «касается», другой использует второй «[event allTouches]». так или иначе, какая разница между ними. в какой ситуации использовать первую, какая ситуация использует вторую. БЛАГОДАРЯ! здесь больше деталей:разница между двумя параметрами в методе типа - (void) touchesEnded: (NSSet *) затрагивает событиеEvent: (UIEvent *)
// used the first parameter
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSUInteger touchCount = [touches count];
NSUInteger tapCount = [[touches anyObject] tapCount];
methodStatus.text = @"touchesEnded";
touchStatus.text = [NSString stringWithFormat:@"%d touches", touchCount];
tapStatus.text = [NSString stringWithFormat:
@"%d taps", tapCount];
}
// used the second parameter
-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event {
NSSet *allTouches = [event allTouches];
//...
}