NSData *data;
AVFile *imageFile;
if (UIImagePNGRepresentation(image) == nil)
{
data = UIImageJPEGRepresentation(image, 1.0);
imageFile = [AVFile fileWithName:@"image.jpg" data:data];
}
else
{
data = UIImagePNGRepresentation(image);
imageFile = [AVFile fileWithName:@"image.png" data:data];
}
[imageFileCollection addObject:imageFile];
}
[testPost addObjectsFromArray:imageFileCollection forKey:@"testImageArray"];
代码如上,在后台看到testimagearray中显示null;求告知存储查询啊
文件应该先 save,在 callback里看到上传成功后再去 addObject:imageFile