【发布时间】:2016-04-27 11:15:57
【问题描述】:
我有类似这样的JSON 格式要求。
{
"first_name" : "XYZ",
"last_name" : "ABC"
}
我在NSString 中有值。
NSString strFName = @"XYZ";
NSString strLName = @"ABC";
NSString strKeyFN = @"first_name";
NSString strKeyLN = @"last_name";
我使用NSMutableDictionary
NSMutableDictionary* dict = [[NSMutableDictionary alloc]init];
[dict setObject:strFName forKey:strKeyFN];
[dict setObject:strLName forKey:strKeyLN];
那么输出就是
{
first_name = XYZ,
last_name = ABC
}
所以我不想用“=”来分隔键和值,而是用“:”来分隔键和值
stack overflow questions 的大部分内容我都去过,但没有帮助仅在输出中获得“=”
所以请帮忙?
【问题讨论】:
标签: ios objective-c json nsmutabledictionary