加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 我们可以使用什么而不是nstimer?

发布时间:2020-12-14 19:13:06 所属栏目:百科 来源:网络整理
导读:我可以使用[locationManager startUpdatingLocation]在后台获取GPS位置,但我不知道如何安排它.我已经使用NSTimer进行调度,但是他们中的许多人都说如果应用程序进入后台,NSTimer将会过期. 如果我们不使用NSTimers,我想知道如何安排调用方法. 解决方法 Apple提
我可以使用[locationManager startUpdatingLocation]在后台获取GPS位置,但我不知道如何安排它.我已经使用NSTimer进行调度,但是他们中的许多人都说如果应用程序进入后台,NSTimer将会过期.

如果我们不使用NSTimers,我想知道如何安排调用方法.

解决方法

Apple提供了5种app后台运行任务:

  • Apps that play audible content to the user while in the background,such as a music player app
  • Apps that keep users informed of their location at all times,such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Newsstand apps that need to download and process new content
  • Apps that receive regular updates from external accessories

Refer this link for location updates while app is in background

Also refer this tutorial for further help

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读