ios - How to Custom group notify for blocks of functions -


asynchronous block called in function, add these multiple functions group,process results of blocks when block execute completely.is there common , smart method implement?
dispatch_group_notify ,completionblock

example

dispatch_group_notify

nsblockoperation

dispatch_group_t _blocktaskgroup; .....  if (!_blocktaskgroup) {     _blocktaskgroup = dispatch_group_create(); }  dispatch_group_notify(_blocktaskgroup, dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{     nslog(@"finally!"); });  ....  dispatch_group_enter(_blocktaskgroup); [xxxxx computeinbackground:xx completion:^{     nslog(@"1 done");     dispatch_group_leave(group); }]; // dispatch_group_enter(_blocktaskgroup); [xxxxx computeinbackground:xx completion:^{     nslog(@"2 done");     dispatch_group_leave(_blocktaskgroup); }]; // dispatch_group_enter(_blocktaskgroup); [xxxxx computeinbackground:xx completion:^{     nslog(@"3 done");     dispatch_group_leave(_blocktaskgroup); }]; 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -