gpt4 book ai didi

iphone - 我们可以用什么代替 nstimer?

转载 作者:可可西里 更新时间:2023-11-01 04:48:21 25 4
gpt4 key购买 nike

我可以使用 [locationManager startUpdatingLocation] 在后台获取 GPS 位置,但我不知道如何安排它。我已经使用 NSTimer 进行调度,但他们中的许多人都说如果应用程序进入后台,NSTimer 将过期。

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

最佳答案

Apple 提供了 5 种在后台运行的应用程序任务:

  • 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

关于iphone - 我们可以用什么代替 nstimer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10169241/

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