标签:queue nbsp 回调 汇总 async 结果 creat sync get
//多个异步请求完成后汇总结结果(任务执行不区分先后顺序)
dispatch_queue_t queue = dispatch_get_global_queue(0,0);
dispatch_group_t group = dispatch_group_create();
dispatch_group_async(group, queue, ^{/*任务a */ });
dispatch_group_async(group, queue, ^{/*任务b */ });
dispatch_group_async(group, queue, ^{/*任务c */ });
dispatch_group_async(group, queue, ^{/*任务d */ });
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
// 在a、b、c、d异步执行完成后,会回调这里
});
标签:queue nbsp 回调 汇总 async 结果 creat sync get
原文地址:https://www.cnblogs.com/LGX3399577/p/ui.html