Maintaining a list of all active UITouch'es
Hi,
I need to maintain a list of all active UITouches (sorted).
touchesBegan/Ended/Moved appear to be called at random intervals and each have a list of different touches in different phases (not all relative to the function name).
My idea is to maintain an NSMutableDictionary.
touchesBegan:
Add to the list (if the [touch hash]) doesnt already exist. (And the phase is began)
touchesEnd:
Remove from the list (if the [touch hash]) exists. (And the phase is ended)
touchesMoved
Update (?) the UITouch. However the UITouch pointers will be valid? Or will they have been released, i.e. Should I maintain my own allocated list of UITouches and copy over the data for each time we recieved touchesMoved?
Thanks for clarifying!
Ashley.
|