美文网首页
线程组请求多个接口

线程组请求多个接口

作者: 那个谁_5207 | 来源:发表于2017-08-01 16:48 被阅读2次

    dispatch_group_t group = dispatch_group_create();

    dispatch_group_enter(group);

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

    dispatch_group_leave(group);

    });

    dispatch_group_enter(group);

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

    dispatch_group_leave(group);

    });

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

    //汇总mode

    dispatch_async(dispatch_get_main_queue(), ^{

    });

    });

    相关文章

      网友评论

          本文标题:线程组请求多个接口

          本文链接:https://www.haomeiwen.com/subject/gtojlxtx.html