当我启动我的应用程序时,它会显示一个带有用户位置的mapView,但是mapView没有立即showUserLocation,打印一些错误,大约3分钟后,它调用'didUpdateUserLocation',然后它显示用户的位置。大约几分钟它定位成功,在成功之前定位总是失败。
我的代码在iOS7中运行良好,但在iOS9中有这个问题,我不知道为什么。
我在viewDidLoad()中调用self.locationManger.startUpdatingLocation()。
这是我的mapView
lazy var mapView: MKMapView = {
var tempMapView = MKMapView(frame: self.view.bounds)
tempMapView.mapType = MKMapType.Standard
tempMapView.showsUserLocation = true
tempMapView.userTrackingMode = MKUserTrackingMode.Follow
tempMapView.delegate = self
return tempMapView
}()下面是打印错误
/BuildRoot/Library/Caches/com.apple.xbs/Sources/ProtocolBuffer/ProtocolBuffer-242/Runtime/PBRequester.m:807 server (https://gsp13-cn.ls.apple.com/localshift) returned error: 504
/BuildRoot/Library/Caches/com.apple.xbs/Sources/ProtocolBuffer/ProtocolBuffer-242/Runtime/PBRequester.m:807 server (https://gsp13-cn.ls.apple.com/localshift) returned error: 503发布于 2015-11-30 17:23:39
调用Startupdate位置:
manager = CLLocationManager()
manager.delegate = self
manager.desiredAccuracy = kCLLocationAccuracyBest
manager.startUpdatingLocation()还要检查一下:http://nshipster.com/core-location-in-ios-8/
https://stackoverflow.com/questions/33992992
复制相似问题