多个请求 最后一个请求回来做一件事情(异步请求)

   NSString *ids = [NSString stringWithFormat:@"%lld,%lld,%zd;", aid, vid, site];
    
    dispatch_group_t group = dispatch_group_create();
    
    dispatch_group_enter(group);
    [self requestAlbumPlayCountWithIds:ids CallBack:^{
        dispatch_group_leave(group);
    }];
    
    dispatch_group_enter(group);
    [self requestAlbumScoreWithIds:ids CallBack:^{
        dispatch_group_leave(group);
    }];
    
    dispatch_group_notify(group, dispatch_get_main_queue(), ^{
        if (callback) {
            callback();
        }
    });
    
    dispatch_release(group);

你可能感兴趣的:(多个请求 最后一个请求回来做一件事情(异步请求))