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

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: