iOS NSTimer简单使用

2016-05-09  本文已影响0人  MonkeysAndTyper

1 计时器添加到NSRunloop

self.timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(nextPage) userInfo:nil repeats:YES];
    //添加到runloop中
   [[NSRunLoop mainRunLoop]addTimer:self.timer forMode:NSRunLoopCommonModes];
上一篇 下一篇

猜你喜欢

热点阅读