【发布时间】:2013-04-23 06:03:51
【问题描述】:
我在使用 CLLocationManager 时遇到问题。
我正在使用startUpdatingLocation 方法及其委托方法
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
我收到了newHeading.trueHeading。
问题是 newHeading.trueHeading 有时会返回 -1,一旦设备开始返回 -1,它就会保持不变,这意味着它总是返回 -1。
谁能告诉我这个问题的技术细节和解决方法。
在探索 Apple 的文档时,我发现了
"A negative value means that the reported heading is invalid, which can occur when the device is uncalibrated or there is strong interference from local magnetic fields."
但没有信息如何避免或解决方法。
注意:我正在真实设备 iPhone 4、iPhone 4S、iPad 2 和 iPad 3 上测试此应用。
【问题讨论】: