見出しを使用するシンプルな 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;
}
コンパスのキャリブレーションを取得するにはどうすればよいですか? ありがとう。