gpt4 book ai didi

ios - 航向校准消失?

转载 作者:行者123 更新时间:2023-11-29 10:50:04 24 4
gpt4 key购买 nike

在 GPS/航向处于事件状态时,我的应用可能会长时间无人关注。为了管理校准罗盘弹出窗口是否出现,我已经这样做了。

-(BOOL) locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager {
// NSTimer *dismissHeadingSoon;
// dismissHeadingSoon = [NSTimer scheduledTimerWithTimeInterval:200
// target:self selector:@selector(removeHeadingCalibration:) userInfo:nil repeats:NO];
return YES;
}

-(void) removeHeadingCalibration:(NSTimer *)timer {
[locationManager dismissHeadingCalibrationDisplay];
}

我想要一个计时器在一段时间后关闭弹出窗口(在上面注释掉)。我的问题是:校准界面现在只出现半秒就直接消失了?所以我的代码现在只说是,没有任何计时器启动。如果我删除委托(delegate),它会正常工作。

文档说"返回值YES 如果你想允许显示航向校准警报;不,如果你不这样做。”

我做错了什么?(ios7 和 xcode 5.1)

最佳答案

在与 Apple DTS 工程师讨论后发现,如果您还连接了位置管理器,则无法使用 mapView (MKUserTrackingModeFollow) 中的航向功能。您需要将 userTrackingMode 设置为 MKUserTrackingModeNone 并使用 MKMapCamera 显示带有来自位置管理器的航向的 map 。当我实现locationManagerShouldDisplayHeadingCalibration,我的代表最终与 map View 发生碰撞,并且最终相互抵消。这就是为什么将其关闭会导致出现校准屏幕的原因。由于我的应用程序会在无人关注的情况下使用数小时,因此取消校准屏幕很重要,这样我就可以同时拥有它。

关于ios - 航向校准消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20822751/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com