0
我花了一些時間嘗試搜索這個,但我還沒有找到解決方案。我正在嘗試訪問字典中的特定數組值。以下是我想要做的一般代碼/解釋。如何在swift中訪問字典中包含的數組元素
var dict = ["1": [1,2,3,4,5], "2": [6,7,8,9,10], "3": [11,12,13,14,15]]
//now lets say I want to access the 3rd value of dict["2"] = 8
//I have tried the following and failed
print(dict["2": [2]])
print(dict["2"][2])
感謝
謝謝你,就這麼簡單! – abuessing
高興地幫助你.. :) –