我有一個主詞典是這樣的:篩選和排序
data = [{"key1": "value1", "key2": "value2", "key3": "value3"}, {"key1": "value1", "key2": "value5", "key3": "value6"}, {"key1": "value2", "key2": "value2", "key3": "value9"} ]
,我需要創建一個字典出它假定存在的[value for "key1"]
和[value for "key2"]
一個獨特的組合:
即,我需要建立就像一本字典:
result = [{"value1" {"value2" : "value3", "value5" : "value6"}}, {"value2" {"value2" : "value9"}}]
以及如何做的NSArray(如標題這麼說)有什麼關係你的問題嗎? – TheAmateurProgrammer
更改了標題。謝謝。 –