我在使用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 上测试这个应用程序。