GCD队列组的使用

dispatch_group_t group = dispatch_group_create();

    

    dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{

        NSLog(@"------CCCCCCCCC-------");

    });

    dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{

        NSLog(@"------BBBBBBB-------");

    });

    dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{

        NSLog(@"------AAAAAA-------");

    });

    dispatch_group_notify(group, dispatch_get_global_queue(0, 0), ^{

       

        NSLog(@"执行结束。。。。。。。");

    });

 

 

 

2019-02-22 00:51:29.359991+0800 下载图片[6738:214051] ------BBBBBBB-------

2019-02-22 00:51:29.359902+0800 下载图片[6738:214049] ------CCCCCCCCC-------

2019-02-22 00:51:29.360021+0800 下载图片[6738:214050] ------AAAAAA-------

2019-02-22 00:51:29.360508+0800 下载图片[6738:214051] 执行结束。。。。。。。

posted on 2019-02-22 00:54  大圣ios博客  阅读(342)  评论(0编辑  收藏  举报