【发布时间】:2016-10-02 15:14:02
【问题描述】:
在很多地方更新到 Swift 3 后,我都收到了这个错误,我已经更改了 ?和 !但是又出现了一个错误(Type [String : AnyObject]?Has not subscript members)
func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutableRawPointer) {
if !didFindMyLocation {
let myLocation: CLLocation = change? [NSKeyValueChangeNewKey] as! CLLocation //Ambiguous reference to member 'subscript'
viewMap.camera = GMSCameraPosition.camera(withTarget: myLocation.coordinate, zoom: 10.0)
viewMap.settings.myLocationButton = true
didFindMyLocation = true
}
}
【问题讨论】:
标签: swift3