本文介绍了startMonitoringSignificantLocationChanges和startUpdatingLocation如何相互影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在 startMonitoringSignificantLocationChanges 正在运行时调用 startUpdatingLocation 会发生什么? significantLocationChange监控是否会停止?如果我那么 stopUpdatingLocation 那么significantLocationChange监控会继续还是重启?

What happens if I call startUpdatingLocation while startMonitoringSignificantLocationChanges is running? Does significantLocationChange monitoring get stopped? If I then stopUpdatingLocation will significantLocationChange monitoring continue or restart?

我找不到涵盖这两者之间相互影响的文档监控位置的方法。

I can find no documentation covering the interplay between these two ways of monitoring location.

推荐答案

它们并不意味着同时使用。它可以是或者同时为同一委托方法提供标题和位置更改。

They are not meant to be used concurrently. It's either or as they both deliver heading and location changes to the same delegate method.

locationManager:didUpdateToLocation:fromLocation

locationManager:didUpdateToLocation:fromLocation

它们的频率和准确度不同(以及扩展使用的硬件和功率消费)的变化。您作为开发人员需要根据您的用例决定哪个最好

They differ in the frequency and accuracy (and by extension hardware used and power consumption ) of the changes. You as the developer need to decide which is best based on your use case

我需要在不同时间使用这两种方法。当我从一个切换到另一个时,我设置了一个我可以在我的委托中引用的标志,以便我知道更新的类型。

I have a need to use both approaches at different times. When I switch from one to the other I set a flag that I can reference in my delegate so that I know the type of update.

这篇关于startMonitoringSignificantLocationChanges和startUpdatingLocation如何相互影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 15:55