【发布时间】:2011-10-12 08:46:41
【问题描述】:
如何在后台使用 NSTimer 和 applicationDidEnterBackground 方法来调用 locationManager 函数?
【问题讨论】:
-
你能帮帮我吗?????
标签: iphone ios background nstimer core-location
如何在后台使用 NSTimer 和 applicationDidEnterBackground 方法来调用 locationManager 函数?
【问题讨论】:
标签: iphone ios background nstimer core-location
为什么需要计时器?如果您将代理设置为接收来自位置更新的回调,则不需要计时器。如果您需要主动位置跟踪,如果长时间运行,您将遭受巨大的电池冲击。当您进入后台切换到 -monitorForSignificantLocationChanges 时,您会更好。将您的 AppDelegate 注册为 Location Manager Delegate,然后从回调中执行您需要执行的操作。
【讨论】: