iPhone核心位置CLLocationManager更新率 [英] iPhone Core Location CLLocationManager update rate

查看:70
本文介绍了iPhone核心位置CLLocationManager更新率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否可以为CLLocationManager设置恒定的时间更新速率,以强制其连续每10秒更新一次位置?我知道距离过滤器的用法,但是如果出现问题并且位置未更新怎么办?谢谢!

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!

推荐答案

无法控制更新率。您可以设置一个计时器,然后关闭更新,直到计时器结束。这是避免使用过多电源的常用方法。

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.

如果出现问题,则委托方法 locationManager会通知您: didFailWithError:

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

这是一篇不错的文章,显示了如何过滤错误的CoreLocation读数:

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

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

这篇关于iPhone核心位置CLLocationManager更新率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆