dispatch_group_t group = dispatch_group_create();
dispatch_group_enter(group);
NSLog(@“test”);
dispatch_group_leave(group);
dispatch_group_enter(group);
NSLog(@“test1”);
dispatch_group_leave(group);
dispatch_group_enter(group);
NSLog(@“test2”);
dispatch_group_leave(group);
dispatch_group_notify(group, dispatch_get_main_queue(), ^(){
NSLog(@"等待执行");
});