美文网首页
传给后台json

传给后台json

作者: 武个武6个武 | 来源:发表于2017-01-13 10:16 被阅读0次

后台要的格式

参数.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

      本文链接:https://www.haomeiwen.com/subject/vaajbttx.html