iOS 循环线程的实现
2015-08-14 11:43
411 查看
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
0), ^{
NSLog(@"--------");
[NSTimer
scheduledTimerWithTimeInterval:1
target:self
selector:@selector(test:)
userInfo:nil
repeats:YES];
while (!complete) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
});
停止
//complete = YES;
0), ^{
NSLog(@"--------");
[NSTimer
scheduledTimerWithTimeInterval:1
target:self
selector:@selector(test:)
userInfo:nil
repeats:YES];
while (!complete) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
});
停止
//complete = YES;
相关文章推荐
- iOS开发总结——项目目录结构
- js调用安卓和ios代码
- 使用cocoadPod updating local specs repositories 卡住
- iOS中利用NSURLSession进行文件断点下载
- [置顶] iOS百度地图SDK之实时绘制轨迹(后台仍执行)
- xcode插件怎么卸载
- ios开发_Runtime
- nagios服务器磁盘损坏==修复方法
- IOS 时间戳
- Nagios安装
- Nagios配置之Windows
- 正则表达式在iOS中的运用
- ios代码实现Autolayout(自动布局)的简单讲解
- iOS学习之AutoLayout常用方法
- Undefined symbols for architecture armXX
- iOS中NSString常用操作合集
- IOS 四种保存数据的方式
- iOS内置音频
- IOS应用程序生命周期
- iOS开发之CGPoint、CGSize、CGRect、CGRectMake、window(窗口)、视图(view)