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 ...が含まれますが、「textwriting」、「size」...がすべて一緒に含まれていないキー「text1」が必要です。
このようなものかもしれません:
{
"menu": {
"header": "xProgress SVG Viewer",
"items": [
{
"id": "Open"
},
助けてくれてありがとう