我有一个使用标题的简单 iOS 应用程序。但是由于精度非常差(10 到 25 度),我实现了 locationManagerShouldDisplayHeadingCalibration 函数。但是它永远不会被调用。这是我的代码:
...
locmanager = [CLLocationManager new];
[locmanager setDelegate:self];
[locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
[locmanager setHeadingFilter:kCLHeadingFilterNone];
[locmanager setHeadingOrientation:CLDeviceOrientationLandscapeLeft|CLDeviceOrientationLandscapeRight];
if ([CLLocationManager locationServicesEnabled])
{
[locmanager startUpdatingLocation];
[locmanager startUpdatingHeading];
}
...
- (void)locationManager:(CLLocationManager*)manager didUpdateHeading:(CLHeading*)newHeading
{
// This one gets called
}
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager
{
// This one does NOT get called
NSLog ("Here");
return YES;
}
我应该怎么做才能获得指南针校准?谢谢。