iPhone Core Location CLLocationManager update rate

前提是你 提交于 2019-12-06 12:41:36

问题


Can you set up a constant time update rate for CLLocationManager to force it update locations like every 10 seconds continuously? I know the usage of the distance filter but what if something went wrong and the location is not updated? Thanks!


回答1:


It's not possible to control the update rate. You can set a timer, then turn off the updates until the timer ends. This is the usual thing to do to avoid using too much power.

If there's a problem, you will be informed by the delegate method locationManager:didFailWithError:

Here's a good post which shows how to filter bad CoreLocation readings:

http://troybrant.net/blog/2010/02/detecting-bad-corelocation-data/



来源:https://stackoverflow.com/questions/2242247/iphone-core-location-cllocationmanager-update-rate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!