yus*_*024 18
是
let myDictionary: [String: [Int]] = ["Hello": [1, 2, 3], "World": [4, 5, 6]]
Run Code Online (Sandbox Code Playgroud)
实际上,如果您分配了初始值,则甚至不需要显式类型声明.它可以简单到:
let myDictionary = ["Hello": [1, 2, 3], "World": [4, 5, 6]]
Run Code Online (Sandbox Code Playgroud)
要使用该值:
println(myDictionary["Hello"][0]) // Print 1
println(myDictionary["World"][0]) // Print 4
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12737 次 |
| 最近记录: |