简体   繁体   English

UITouch-是否可以禁用多次点击

[英]UITouch - Is it possible to disable multiple tapping

I would like to have each UITouch instance record a single tap. 我想让每个UITouch实例记录一次点击。 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 谢谢,道格

What is behind this question is my need to associate a unique address with each UITouch instance for each tap. 这个问题的背后是我需要为每个点击将唯一地址与每个UITouch实例相关联。

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. 我已经在touchesBegan:withEvent中使用NSLog-ing了一段时间,并且让我惊奇地意识到UITouch实例似乎被一遍又一遍地回收(即,同一指针地址出现在不同的触摸序列中!)而不是每次启动触摸序列时都重新创建。

My goal is a single unique UITouch instance address with a tapCount = 1. 我的目标是使用tapCount = 1的单个唯一UITouch实例地址。

您可以包括委托方法来捕获多个触摸,而让此方法多次调用您的单个触摸方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM