在xcode7上出现CLLocation错误

时间:2016-01-14 04:19:26

标签: swift xcode7

错误说'CLLocation'中的Downcast?只打开选项;你的意思是用'!'?我该如何解决这个问题?

    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
   //the code below is the error i got for
    var location = locations.last as! CLLocation

    self.currentLocation = location
    var userInfo = [ LMLocationInfoKey : location]
    NSNotificationCenter.defaultCenter().postNotificationName(LMLocationUpdateNotification as String, object:self, userInfo: userInfo)
    self.locationManager_.stopUpdatingLocation()
}

0 个答案:

没有答案