开发者

iPhone multitouch - Some touches dispatch touchesBegan: but not touchesMoved:

I'm developing a multitouch application. One touch is expected to move, and I need to track its position. For all other touches, I need to track their beginnings and endings, but their movement is less critical.

Sometimes, when 3 or more touches are active, my UIView does not receive touchesMoved: events for the moving touch. This problem is intermittent, and can always be reproduced after a few attempts:

  • Touch the screen with 2 fingers.
  • Touch the screen with another finger, and move this finger around.
  • The moving finger always dispatches touchesBegan: and touchesEnded:, but sometimes does not dispatch any touchesMoved: events.

Whenever the moving touch does not dispatch touchesMoved: events, I can force it to dispatch touchesMoved: if I move one of the other touches. This seems to "force" every touch to recheck its position, and I successfully receive a touchesMoved: event. However, this is clumsy.

This bug is reproducible on both the iPhone 2G and 3GS models.

My question is: How do I ensure that my moving touch dispatches touchesMoved: events?

Does anyone have any experience with this issue? I've spent several days searching for answers. I found a post describing how to sync touch events with the VBL开发者_开发百科: http://www.71squared.com/2009/04/maingameloop-changes/ . However, this has not solved the problem.

I really don't know how to proceed. Any help is appreciated!


This was a bug in iPhone OS 3, it has been fixed in iOS 4.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜