close
// 建立Group
dispatch_group_t group = dispatch_group_create();
// Group 1 Async
dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self Process];
});
// Group 2 Async
dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self Process];
});
// 當 Group 1, Group 2都完成時,執行Block
dispatch_group_notify(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSLog(@"完成了");
});
參考資料:
全站熱搜
留言列表