【发布时间】:2015-08-12 04:29:25
【问题描述】:
我有一个 CLLocation 管理器。它工作正常。
locManager = CLLocationManager()
locManager.delegate = self
locManager.desiredAccuracy = kCLLocationAccuracyBest
locManager.requestWhenInUseAuthorization()
locManager.startUpdatingLocation()
当然,我有委托方法:
func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
println("didfail")
println(error)
}
func locationManager(manager:CLLocationManager, didUpdateLocations locations:[AnyObject]) {
println("location manager called..")
let locationLast = locations.last as! CLLocation
latitude = locationLast.coordinate.latitude.description
longitude = locationLast.coordinate.longitude.description
locManager.stopUpdatingLocation()
//....
}
它的工作没有任何问题!但是,当我在这里 47.5775679 19.0488392 (或在此点的 1-2 公里半径内)时,会抛出此错误:
Error Domain=kCLErrorDomain Code=0 "无法执行该操作 完全的。 (kCLErrorDomain 错误 0.)"
我也尝试过使用模拟器和真实设备。当我尝试时,我在真实设备上有互联网连接。有黑洞吗? :) 或者我不知道。
谁能给我任何想法,是什么导致了这种现象?
谢谢!
【问题讨论】:
-
您是否尝试在同一位置运行地图应用?它是否显示您的位置?准确性好吗?
标签: ios swift cllocationmanager