/*
__block void (^callback)() = [^{
float second = 2.0;
bool _stop = NO;
if(_stop) {
NSLog(@"all done");
callback = nil; // break retain cycle
} else {
NSLog(@"still going");
NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
[dic setObject:object forKey:key];
[_service listMessages:^(id response, NSError *error) {
//获取主线程,更新界面
if (error) {
//show error
}else{
获取数据
}
dispatch_async(dispatch_get_main_queue(), ^{
//更新界面
[table reloadData];
[self scrollTableToFoot];
});
}
} parameters:dic];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, second * NSEC_PER_SEC),
dispatch_get_main_queue(),
callback);
}
} copy];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2.0 * NSEC_PER_SEC),
dispatch_get_main_queue(),
callback);
*/
DISPATCH TIMER
原创
©著作权归作者所有:来自51CTO博客作者lisiben的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Dispatch Queue 之 dispatch_sync

Dispatch教程 Dispatch