如何向 json 文件添加多个密钥?
NSArray *keys = [NSArray arrayWithArray:allkeys];
NSArray *objects = [NSArray arrayWithArray:allobjects];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
正如您在上面看到的,jsonDictionary 的键是键,但我想要一个里面有更多键的键。我尝试了“forKeys:keys,keys2”(keys2 另一个数组,但不起作用。现在这是结果:
{"text2":"Untitled {{400, 100}, {200, 100}} <UICFFont: 0x2c3960> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 12px","text3":"Untitled {{400, 100}, {200, 100}} <UICFFont: 0x2c3960> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 12px","text1":"Untitled {{400, 100}, {200, 100}} <UICFFont: 0x2c3960> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 12px"}
数组键包含 Text1、text2... 数组对象包含 Untitled、size... 但我想要一个键“text1”,里面有“text writing”、“size”... 不是全部在一起。
可能是这样的:
{
"menu": {
"header": "xProgress SVG Viewer",
"items": [
{
"id": "Open"
},
在此先感谢您的帮助