【发布时间】:2014-09-11 17:18:16
【问题描述】:
我在操场上编写了这段代码来代表我的问题:
import Foundation
var countries = ["Poland":["Warsaw":"foo"],"England":["London":"foo"]]
for (country, city) in countries {
if city["London"] != nil {
city["London"] = "Piccadilly Circus" // error because by default the variables [country and city] are constants (let)
}
}
有没有人知道解决方法或完成这项工作的最佳方法?
【问题讨论】:
标签: swift