touchesBegan / Ended incorrectly identifying second, third, etc. touch
Posted
by Rob
on Stack Overflow
See other posts from Stack Overflow
or by Rob
Published on 2010-04-28T02:51:38Z
Indexed on
2010/04/28
2:53 UTC
Read the original article
Hit count: 430
I have an issue where touchesBegan and touchesEnded are incorrectly identifying my second, third, etc touch if I continue to hold down my first touch.
If I lift my finger up off the first touch, then it will recognize the next touch just fine. It's only when I hold my first touch down continuously and then try and touch a different area with a different finger at the same time. It will then incorrectly register that second touch as being from the first touch again.
Any insights into how I can fix this?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches anyObject];
NSString* filename = [listOfStuff objectAtIndex:[touch view].tag];
// do something with the filename now
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
ITouch* touch = [touches anyObject];
NSString* buttonPressed = [listOfStuff objectAtIndex:[touch view].tag];
// do something with this info now
}
© Stack Overflow or respective owner