多任务线程

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(@"等待执行");
});

你可能感兴趣的:(多任务线程)