传给后台json

后台要的格式

参数.png

我先保存为字典 然后转化成json

NSDictionary *dataDic = [NSDictionary dictionaryWithObject:picIdStr forKey:@"attach_ids"];
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dataDic options:NSJSONWritingPrettyPrinted error:&error];
NSString *extraStr = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];

picIdStr是我之前存“1,2,3”的字符串

你可能感兴趣的:(传给后台json)