我有以下代码:如何更改NSTimer的时间?
timer = [[NSTimer scheduledTimerWithTimeInterval:0.50 target:self selector:@selector(onTimer) userInfo:nil repeats:YES] retain];
-(void) onTimer
{
}
每0.50秒的OnTimer
方法被称为后。
但现在我想增加时间间隔。
这意味着:
OnTimer calls after 0.55
OnTimer calls after 0.60
OnTimer calls after 0.65
OnTimer calls after 0.70
OnTimer calls after 0.75
& so on.
对此有任何解决方案?我尝试了很多,但没有成功。
谢谢,它现在工作正常。 – 2010-11-12 04:27:01
定时器结束时,NSTimer对象将自动处理。 – qwertz 2013-05-29 19:36:07