相关疑难解决方法(0)

等待异步方法在for循环中完成

我有一个包含三个异步方法的for循环,我希望在这3个异步方法完成后进行一些处理.

 -(void)getAllUsersInformations{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
           for(User *user in users){
              [self getUserInfo:user];
           }
      //Here, I want to reload the table view for example, after finishing the for loop (executing the whole three methods).
    });
}

-(void)getUserInfo:(User*)user{
     [self getInformations:user];
     [self getExperiences:user];
     [self getEducation:user];
}
Run Code Online (Sandbox Code Playgroud)

你有任何技术可以得到这个结果吗?非常感谢你.

grand-central-dispatch ios

6
推荐指数
1
解决办法
4348
查看次数

标签 统计

grand-central-dispatch ×1

ios ×1