错误域=kCLErrorDomain代码=0“;(无效)“;IOS 9.3

错误域=kCLErrorDomain代码=0“;(无效)“;IOS 9.3,ios,location,mapkit,Ios,Location,Mapkit,我已经尝试在产品->方案->允许设置当前位置中设置默认位置 func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location: CLLocation = locations.first! self.mapView.centerCoordinate = location.coordinate let reg = MKCoord

我已经尝试在产品->方案->允许设置当前位置中设置默认位置

func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    let location: CLLocation = locations.first!
    self.mapView.centerCoordinate = location.coordinate
    let reg = MKCoordinateRegionMakeWithDistance(location.coordinate, 1500, 1500)
    self.mapView.setRegion(reg, animated: true)
    geoCode(location)


}

func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
    print(error)
}

您是否在
info.plist
文件中设置了授权请求字符串?这是CLLocation的常见陷阱是的,我解决了这个问题,是info.plist。问题您是否在
info.plist
文件中设置了授权请求字符串?这是CLLocation的常见陷阱是的,我解决了这个问题,是info.plist。问题