您的位置:首页 > 移动开发 > IOS开发

IOS添加计时器的两种方法

2015-10-21 17:04 453 查看
// 添加计时器的两种方法:1

timerShop=[NSTimer
scheduledTimerWithTimeInterval:3
target:self
selector:@selector(nextImage)
userInfo:nil
repeats:YES];

//触发计时器

[timerShop
fire];

//添加计时器的两种方法:2

//timerShop=[NSTimer timerWithTimeInterval:3 target:self selector:@selector(nextImage) userInfo:nil repeats:YES];

// [[NSRunLoop currentRunLoop] addTimer:timerShop forMode:NSDefaultRunLoopMode];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: