【发布时间】:2012-05-17 18:02:35
【问题描述】:
我需要在 30 秒的持续时间内每 0.025 秒拨打一次电话。这是我的 0.025 秒计时器。
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 0.025 target: self
selector: @selector(GetScreen:) userInfo: nil repeats:YES ];
如何将其限制为 30 秒的持续时间?
【问题讨论】:
-
仅在 30 秒内是什么意思?你只想要一次吗?
-
因为现在当我调用我编写的这个函数时,将每 0,025 调用一次,直到应用程序被关闭。我想每 0,025 调用一次,但在 30 秒内我不想调用这个函数,所以我想做的是调用它 30*0,025 次。
标签: iphone nstimer scheduler intervals