定时器
来源:互联网 发布:最新网络捕鱼平台 编辑:程序博客网 时间:2024/06/05 11:52
NSTimer *time1 = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(loadUserInfo) userInfo:nil repeats:YES]; ```不用添加到 RunLoop 中, 系统自动添加, 但是没用办法设置 runLoop的模式
NSTimer *time = [NSTimer timerWithTimeInterval:2.0 target:self selector:@selector(loadUserInfo) userInfo:nil repeats:YES];
“`
[[NSRunLoop currentRunLoop]addTimer:time forMode:NSRunLoopCommonModes];
需要添加到 NSRunLoop 中否则 不执行
[time1 fire];
能让定时器 的第一次执行,不必等待
0 0
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- Mac版R语言入门(二)R语言的基本命令操作
- 今天配置apche导致无法连接服务器
- 点击整行选定checkbox
- POJ 2983 Is the Information Reliable?(差分约束系统+BellmanFord)
- 让easyui-datebox控件只显示年份和月份
- 定时器
- 上传图片本地html+css
- hadoop源码之hdfs(1)---通信协议
- Github上优秀的开源项目
- 【每日一课】5、Dos窗口及常用命令
- Ubuntu下搭建LAMP
- 怎么判断32位系统下是大端还是小端
- 搬瓦工VPS多用户SS配置
- 机器学习常见算法分类汇总