我试图在自定义对象中上传文件,但它不会上传文件。该文件甚至没有上传,而且"附件"数据库上的字段保持为空。 如果我尝试在没有QBCOFile的情况下发送数据,它会上传但是附件"字段保持为空。
我的代码:
QBCOCustomObject *object = [QBCOCustomObject customObject];
object.className = @"Custom";
[object.fields setObject:@"blue" forKey:@"color"];
QBCOFile *file = [QBCOFile file];
file.name = @"Picture";
file.contentType = @"image/png";
file.data = UIImagePNGRepresentation(stone.picture);
[object.fields setObject:file forKey:@"attachment"];
NSMutableArray *customObjects = [NSMutableArray new];
[customObjects addObject:object];
[QBCustomObjects createObjects:customObjects className:@"Custom" delegate:self];
答案 0 :(得分:1)
这是一种错误的方式,
查看本指南http://quickblox.com/developers/SimpleSample-customObjects-ios#Files
你需要下一个: