nsTimer的简单用法
2013-09-10 13:53 甘超波 阅读(2735) 评论(0) 收藏 举报//用nstimer的用法 一种用法,要手动加入到NsRunLoop中 NSTimer *time= [NSTimer timerWithTimeInterval:3 target:self selector:@selector(NoticeTransation) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:time forMode:NSDefaultRunLoopMode];//手动加入到NSRunLoop中 [time fire];//立即触发定时器 //第二种方法 NSTimer *timer= [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(NoticeTransation) userInfo:nil repeats:YES]; [timer fire];
参考文章http://blog.csdn.net/samuelltk/article/details/7484533
目前我正在专注NLP,请立刻加微信/QQ号 546611623, 免费送你原创《NLP高级执行师》高清视频
浙公网安备 33010602011771号