【发布时间】:2018-04-08 08:50:01
【问题描述】:
我正在尝试在我的应用程序中使用 kCLLocationAccuracyHundredMeters 的位置精度来更新我的标准位置,这在一段时间内似乎工作得相对较好,但每隔一段时间我会收到 10 分钟更新之间的差距(在不同方向行驶数英里时)似乎与设置不符。这是我的位置管理器上的设置。此外,我只使用前台位置更新,所以对于这些测试,我一直在屏幕上,应用程序始终在前台。
self.locManager = [[CLLocationManager alloc] init];
self.locManager.delegate = self;
self.locManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
self.locManager.distanceFilter = 15;
我用相同的其他设置尝试了 kCLLocationAccuracyBest,我在整个驾驶过程中得到了完美的测量结果,但我不需要那么精确的位置。我假设百米精度仍然会提供相对一致的更新,但精度较低,这正是我们正在寻找的。p>
这只是使用 kCLLocationAccuracyHundredMeters 设置与 kCLLocationAccuracyBest 的副作用吗?
在 iPhone 6s:11.0.2 和 iPhone 7Plus:11.0.3 上测试
感谢任何帮助,谢谢!
编辑:
我应该澄清一下,我确实在下面列出的 CLLocationManager 委托方法中设置了日志记录,但从未收到任何回调/日志。
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
- (void)locationManager:(CLLocationManager *)manager didFinishDeferredUpdatesWithError:(nullable NSError *)error;
- (void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager;
- (void)locationManagerDidResumeLocationUpdates:(CLLocationManager *)manager;
【问题讨论】:
标签: ios objective-c cllocationmanager cllocation