dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
for (int i =0; i<base64StringArr.count;i++)
{
dispatch_async(queue, ^{
NSDictionary*Dict=[TYNetWorkProtocol tyUploadImageWithImageData:base64StringArr[i] ext:@"png"];
[HTTPManager postRequestWithProtoPic:Dict successHandler:^(NSDictionary *resposed)
{
if ([resposed[@"result"] integerValue]==1)
{
[weakSelf.MutablePicArr addObject:resposed[@"data"]];
if (weakSelf.MutablePicArr.count==base64StringArr.count)
{
NSSLog(@"**全部添加,退出循环**");
[self hideHud];
[self confirmtupic];
}
}
} failHandler:^{
[weakSelf showHudWithHint:@"图片上传失败,请重试!"];
}];
});
}
网友评论