Swift 词典未打印键值
Swift Dictionary is not printing key values
我是 swift 编程新手。我已经编写了以下用于迭代和打印字典的代码
var items_price = [
"milk": 1 ,
"bread" : 3,
"egg" : 2
]
for (myKey, myValue) in items_price {
println ("\(myKey) costs : \(myValue)")
}
此代码未将结果打印为 "milk costs: 1" 等。怎么了?
println
语句打印在游乐场的时间轴上。按打印语句行末尾圆圈中的“+”。
我是 swift 编程新手。我已经编写了以下用于迭代和打印字典的代码
var items_price = [
"milk": 1 ,
"bread" : 3,
"egg" : 2
]
for (myKey, myValue) in items_price {
println ("\(myKey) costs : \(myValue)")
}
此代码未将结果打印为 "milk costs: 1" 等。怎么了?
println
语句打印在游乐场的时间轴上。按打印语句行末尾圆圈中的“+”。