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];
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];
相关文章推荐
- iOS 内存管理(strong weak copy)详解
- fir.im Weekly - 热门 iOS 第三方库大盘点
- 有时间整理一下 iOS后台计时器。
- iOS 精益编程
- IOS 世界标准时间UTC /GMT 转为当前系统时区对应的时间
- 【iOS】GitHub删除respository(仓库)、fork项目
- fir.im Weekly - 热门 iOS 第三方库大盘点
- IDFA - 2
- IOS9 解决中文乱码
- ios Autolayout改变约束, 动画效果处理
- iOS常用字符串使用
- iOS中的中间人-NSURLProtocol 的原理和使用实例
- iOS中GIF的制作的简单版本记录
- iOS:GIF图片的预览以及生成
- iOS8的三种分辨率
- iOS开发笔记-xcode7提交错误:iPad Multitasking support
- Ios学习
- ios中block的学习总结
- ios之"performSelector may cause a leak because its selector is unknown"警告原因及其解决办法
- iOS:自动布局Autolayout