iOS 七牛多张图片上传

-(void)uploadImages:(NSArray *)images atIndex:(NSInteger)index token:(NSString *)token uploadManager:(QNUploadManager *)uploadManager keys:(NSMutableArray *)keys{
UIImage *image = images[index];
__block NSInteger imageIndex = index;
NSData *data = UIImageJPEGRepresentation(image, 0.5);
NSTimeInterval time= [[NSDate new] timeIntervalSince1970];
NSString *filename = [NSString stringWithFormat:@"%@_%ld_%.f.%@",@"status",686734963504054272,time,@"jpg"];
[uploadManager putData:data key:filename token:token
complete:^(QNResponseInfo *info, NSString *key, NSDictionary *resp) {
if (info.isOK) {
[keys addObject:key];
NSLog(@"idInex %ld,OK",index);
imageIndex++;
if (imageIndex >= images.count) {
NSLog(@"上传完成");
for (NSString *imgKey in keys) {
NSLog(@"%@",imgKey);
}
return ;
}
[self uploadImages:images atIndex:imageIndex token:token uploadManager:uploadManager keys:keys];
} } option:nil];
}
上一篇:Git操作指南(2) —— Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并(转)


下一篇:C语言之实现函数返回一个数组,以及选择排序,还有折半查找。这是同学的一个作业。。。