gpt4 book ai didi

iphone - startUpdatingMyLocation是否强制调用iphone sdk中位置管理器的didUpdateToLocation方法

转载 作者:行者123 更新时间:2023-12-03 20:52:53 25 4
gpt4 key购买 nike

我需要澄清一下。 startUpdatingMyLocation 方法必须调用 didUpdateToLocation 吗?位置更新的时候不是会自动调用didUpdateToLocation方法吗?

请伙计澄清我的澄清。

最佳答案

文件说明

Start standard location services by calling the startUpdatingLocation method. This service is most appropriate for applications that need more fine-grained control over the delivery of location events. Specifically, it takes into account the values in the desiredAccuracy and distanceFilter property to determine when to deliver new events. The precision of the standard location services are needed by navigation applications or any application where high-precision location data or a regular stream of updates is required. However, these services typically require the location-tracking hardware to be enabled for longer periods of time, which can result in higher power usage.

For applications that do not need a regular stream of location events, consider using the startMonitoringSignificantLocationChanges method to start the delivery of events instead. This method is more appropriate for the majority of applications that just need an initial user location fix and need updates only when the user moves a significant distance. This interface delivers new events only when it detects changes to the device’s associated cell towers, resulting in less frequent updates and significantly lower power usage.

Regardless of which location service you use, location data is reported to your application via the location manager’s associated delegate object. Because it can take several seconds to return an initial location, the location manager typically delivers the previously cached location data immediately and then delivers more up-to-date location data as it becomes available. Therefore it is always a good idea to check the timestamp of any location object before taking any actions. If both location services are enabled simultaneously, they deliver events using the same set of delegate methods.

因此,您可以使用两者中的任何一个,startUpdatingLocationstartMonitoringSignificantLocationChanges 来获取位置更新,但您必须为委托(delegate)方法调用其中任何一个叫。 (恕我直言)

关于iphone - startUpdatingMyLocation是否强制调用iphone sdk中位置管理器的didUpdateToLocation方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8890665/

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