可以使用dispatch_group
dispatch_group_t serviceGroup = dispatch_group_create();
dispatch_group_enter(serviceGroup);
[configService startWithCompletion:^(ConfigResponse *results, NSError* error){
// Do something with the error or results
dispatch_group_leave(serviceGroup);
}];
dispatch_group_wait(serviceGroup,DISPATCH_TIME_FOREVER);
//需要执行的代码,检测数据
网友评论