将Xcode更新为7.3后,我的代码中出现了3个错误。 Spendet houers解决它......我不知道了。在模拟模式下工作一切都很好,但如果我想为设备编译应用程序,我总会得到3个错误:
模糊地使用下标。在两个foreach中获取错误:(请任何人帮助......
以下是代码:
var citiesNamesArray = [String]()
var citiesIDsArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
let savedCitiesList = NSUserDefaults.standardUserDefaults().arrayForKey("citiesListArray")! as NSArray
for each in savedCitiesList {
citiesNamesArray.append(each[1] as! String)
citiesIDsArray.append(each[0] as! String)
}
for each in savedCitiesList {
cityArray.append(City(cityId: each[0] as! String, cityName: each[1] as! String ))
}
}