xcode告诉我放入预期的','分隔符。以下是我的代码。即使我放入Xcode告诉我的内容我仍然会收到错误。有谁知道我可能做错了什么?
} else {
if let p = placemarks?[0] {
var subThoroughfare:String = ""
if (p.throughfare != nil {
subThoroughfare = p.subThoroughfare
} // there are telling me to put this ',' here
self.addressLabel.text = "\(subThoroughfare) \(p.thoroughfare) \n \(p.subLocality) \n \(p.subAdministrativeArea) \n \(p.postalCode) \n \(p.country)"
} // xcode is telling me to put this ',' here
} // xcode is telling me to put this ',' here
})
答案 0 :(得分:0)
更改代码的这一部分并检查它是否仍显示错误:
if (p.throughfare != nil) {
subThoroughfare = p.subThoroughfare
}
如果它仍然显示错误,请在代码中显示if部分,这将有助于理解完整代码,因为看起来像最后的括号