我将quickblox sdk 1.9与ios集成,用于文件下载和使用此代码
NSString *name =[[[SSCContentManager instance] lastObjectFromFileList] name];
NSString *fileID = [[[SSCContentManager instance] lastObjectFromFileList] UID];
if (fileID > 0) {
// Download file from QuickBlox server
[QBRequest downloadFileWithUID:fileID successBlock:^(QBResponse *response, NSData *fileData) {
if ( fileData ) {
// Add image to gallery
[[SSCContentManager instance] savePicture:[UIImage imageWithData: fileData]];
UIImageView* imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithData:fileData]];
imageView.contentMode = UIViewContentModeScaleAspectFit;
[self showImage:imageView];
//
[[SSCContentManager instance] removeLastObjectFromFileList];
// Download next file
[self downloadFile];
} else {
[[SSCContentManager instance] removeLastObjectFromFileList];
// download next file
[self downloadFile];
}
} statusBlock:^(QBRequest *request, QBRequestStatus *status) {
NSLog(@"progress for %@: %f", name, status.percentOfCompletion);
} errorBlock:^(QBResponse *response) {
NSLog(@"%@", response.error.error);
[[SSCContentManager instance] removeLastObjectFromFileList];
// download next file
[self downloadFile];
}];
}
然后它给出错误QBRequest,找不到或未声明文件数据但是在使用此代码上传文件时
[QBContent TUploadFile:imageData fileName:imageName contentType:@"image/png" isPublic:NO delegate:self];
然后成功上传文件。下载文件有什么问题以及解决方法?