//創(chuàng)建隊列
?dispatch_queue_t queen = dispatch_get_global_queue(0, 0);
//創(chuàng)建隊列組
? ? dispatch_group_t group = dispatch_group_create();
//創(chuàng)建隊列組線程
? ? dispatch_group_async(group, queen, ^{
? ? ? ? NSLog(@"1-%@",[NSThread currentThread]);
? ? });
? dispatch_group_async(group, queen, ^{
? ? ? ? NSLog(@"2-%@",[NSThread currentThread]);
? ? });
?dispatch_group_async(group, queen, ^{
? ? ? ? NSLog(@"3-%@",[NSThread currentThread]);
? ? });
dispatch_group_async(group, queen, ^{
? ? ? ? NSLog(@"4-%@",[NSThread currentThread]);
? ? });
?dispatch_group_notify(group, queen, ^{
? ? ? ? NSLog(@"-------done--------");
? ? });
?dispatch_group_notify 這個是隊列通知,如果以上四個隊列任務都完成了,將會在這里進行回調