![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS
__zhangheng
这个作者很懒,什么都没留下…
展开
-
NSTimer
调用一次计时器方法: [cpp] view plaincopy myTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(scrollTimer) userInfo:nil repeats:NO]; //不重复,只调用一次。tim转载 2014-12-30 11:26:02 · 439 阅读 · 0 评论 -
延时函数和Timer的使用
延时函数和Timer的使用 //延时函数: [NSThread sleepForTimeInterval:5.0]; //暂停5s. //Timer的使用: NSTimer *connectionTimer; //timer对象 //实例化timer self.connectionTimer=[NSTimer scheduledTimerWithTimeInterval:1.5 t转载 2014-12-30 11:27:37 · 1990 阅读 · 0 评论 -
重置定时器
使用简单的操作,设置计时器 - (IBAction)timerStart:(id)sender { if(!secondCounter == 0){ [countdownTimer invalidate]; } else { [self setTimer]; } } 计时器的代码 - (void)timerRun {转载 2014-12-30 11:23:50 · 3137 阅读 · 0 评论