【发布时间】:2010-09-06 13:18:23
【问题描述】:
我有一个 UIViewController 实现,它构建一个核心图像立方体并在发生触摸事件时旋转它。它有以下几种方法:
initController
touchesBegan
touchesMoved
touchesEnded
continueSpinning
我试图在touchesEnded 触发一段时间(比如 2 秒)后继续旋转立方体。我已经创建了 continueSpinning 方法,但我不确定如何在没有触摸方法的情况下调用该方法,例如在计时器上。
我尝试从touchesEnded 调用continueSpinning 并休眠线程并递归调用continueSpinning 但这只是在线程返回时(2 秒后)动画。
我需要某种调用“continueSpinning”的方法,类似于 touchesBegin 方法。
有什么想法吗?
【问题讨论】:
标签: iphone uiviewcontroller core-animation touchesbegan