0
我有不同的鑰匙和商品添加到字典將項目添加到字典:的關鍵
City + Berlin
City + London
City + New York City
Movie + Horror
Movie + Science-Fiction
Movie + Thriller
Food + Burger
Food + Vegetables
Food + Ice Cream
Sports + Baseball
Sports + Soccer
Sports + Tennis
Technology + Apple
我想匹配的鑰匙是一個鍵和值作爲數組匹配的一個關鍵是這樣的:
City: [Berlin, London, New York]
Movie: [Horror, Science-Fiction, Thriller]
etc.
每一對(一個鍵+匹配值)應該放在一個UICollectionViewCell中。
我已經搜索創建和訪問字典,但我無法找到正確的解決方案。
謝謝!
所以,你希望有一個字典,其中鍵是字符串,值是字符串的數組?你的數據來自哪裏?沒有更多的上下文,所有你可以得到的是如何硬編碼這樣的字典,但我想這不會有用...... –