views:

36

answers:

1

Coding inside the function -(void) ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event receiving 2 touches in the "event" variable, how can one detect which touch has lived longer? i know i could use global variables and in the touchbegin just update these variables, but I rather do it the better way, if there is any.

+1  A: 

How about comparing the UITouch timestamp properties?

TomH
That should do it. timestamp tells you: "The time when the touch occurred"
bentford
Sorry, it doesn't do it, the timestamp of a touch is updated on each event, even in the touchesMoved. so you can't use it which touch started first.
Alon Amir