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

发布于 2024-07-23 06:35:04 字数 102 浏览 3 评论 0原文

我想让每个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兔姬 2024-07-30 06:35:04

这个问题背后的原因是我需要为每次点击的每个 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.

国际总奸 2024-07-30 06:35:04

您可以包含委托方法来捕获多次触摸,然后让该方法多次调用您的单次触摸方法。

You could include the delegate method to capture the multiple touches, and just have this method call your single touch method multiple times.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文