dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);//创建信号量 dispatch_queue_t queue = dispatch_get_global_queue(0, 0); //创建队列 dispatch_group_t group = dispatch_group_create(); //创建线程组 dispatch_group_async(group, queue, ^{ NSLog(@"第一个网络请求"); dispatch_semaphore_signal(semaphore); }); dispatch_group_async(group, queue, ^{ NSLog(@"第二个网络请求"); dispatch_semaphore_signal(semaphore); }); dispatch_group_async(group, queue, ^{ NSLog(@"第三个网络请求"); dispatch_semaphore_signal(semaphore); }); dispatch_group_notify(group, queue, ^{ dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); NSLog(@"三个请求完成后执行"); });