UITouch - 是否可以禁用多次点击
我想让每个 UITouch 实例记录一次点击。 换句话说,无论多次点击发生的时间有多近,我都希望它们每次都创建一个独特的触摸实例。 这可能吗?
谢谢, 道格
I would like to have each UITouch instance record a single tap. In other words, regardless of how close multiple taps occur in time, I would like them each to create a unique touch instance. Is this possible?
Thanks,
Doug
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题背后的原因是我需要为每次点击的每个 UITouch 实例关联一个唯一的地址。
我已经在touchesBegan:withEvent:中使用NSLog-ing有一段时间了,我惊讶地意识到UITouch实例似乎被一遍又一遍地回收(即,相同的指针地址出现在不同的触摸序列中!)而不是每次启动触摸序列时都重新创建。
我的目标是一个唯一的 UITouch 实例地址,其 tapCount = 1。
What is behind this question is my need to associate a unique address with each UITouch instance for each tap.
I've been NSLog-ing in touchesBegan:withEvent: for a while now and I've come to the suprising realization that UITouch instances appear to be recycled over and over again (ie, the same pointer address appears in distinct touch sequences!) rather then create anew each time a touch sequence is initiated.
My goal is a single unique UITouch instance address with a tapCount = 1.
您可以包含委托方法来捕获多次触摸,然后让该方法多次调用您的单次触摸方法。
You could include the delegate method to capture the multiple touches, and just have this method call your single touch method multiple times.