iOS-并发一个页面多个请求完成以后再执行其他操作

pragma mark - 开始进行请求数据

- (void)startAllRequest{  
    [self showMBProgressHUDLoding:nil];  
      
    WEAKBLOCK;  
      
    dispatch_group_t group = dispatch_group_create();  
      
    // 广告数组  
    dispatch_group_enter(group);  
    [self getAdHotTopDataBaseRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    // 我的关注  
    dispatch_group_enter(group);  
    [self getDataOfSOurcesFoucesRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    // 推荐比赛  
    dispatch_group_enter(group);  
    [self getDataSourcesCompareRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    //推荐文章  
    dispatch_group_enter(group);  
    [self getDataSourcesArticleRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    //推荐老师  
    dispatch_group_enter(group);  
    [self pageDataAllwithPageRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    //推荐机构  
    dispatch_group_enter(group);  
    [self dealWithOrganizationDataRequestisScu:^(BOOL isScu) {  
        dispatch_group_leave(group);  
    }];  
      
    dispatch_group_notify(group, dispatch_get_main_queue(), ^{  
        [weakSelf RemoveMBProgressHUDLoding:nil];  
        [weakSelf.collectionView reloadData];  
        [weakSelf endRefreshingForTableView:weakSelf.collectionView];  
    });  
}  

你可能感兴趣的:(iOS-并发一个页面多个请求完成以后再执行其他操作)