【发布时间】:2014-12-21 02:04:04
【问题描述】:
我不知道这是否可能...我在 touchesEnded 中有这段代码:
[self performSelector:@selector(GameOver) withObject:nil afterDelay:3];
但是,如果您在 3 秒结束前再次触摸屏幕,我想取消调用 GameOver。知道我该怎么做。
在 touchesBegan 中,我尝试过这样的事情:
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(touchesEnded:withEvent:)
object:nil];
这不起作用。
【问题讨论】:
-
这不是你之前问的同一个问题吗? stackoverflow.com/questions/27585523/…
-
是的哈哈我只是想改写它,因为我决定我想采取一种单独的方法......不过我删除了那个。
标签: ios xcode touchesbegan