我想生成以下格式的 JSON 字符串:
{
"test": {
"currency": "USD",
"gte": "100"
}
}
当我执行以下代码行时:
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
[tempArray addObject:tempDict];
[tempArray addObject:subDict];
[dict setObject:tempArray forKey:@"test"];
我检索了这个 JSON 字符串。
{
"test": [{
"currency": "USD"
}, {
"gte": "100"
}]
}
知道我哪里出错了吗?