iphone - 在后台运行 iOS 应用程序

标签 iphone ios xcode

我想定期将用户当前的纬度和经度发布到服务器。应用程序在前台运行时发布正常。但是如果应用程序在后台运行,有什么办法可以做到这一点?

最佳答案

据我所知,您不应在 applicationDidEnterBackground 中调用任何耗时的函数,因为该应用会在短时间后暂停。

来自 Apple 的 IOS 编程指南

Most applications that enter the background state are moved to the suspended state shortly thereafter. While in this state, the application does not execute any code and may be removed from memory at any time. Applications that provide specific services to the user can request background execution time in order to provide those services.

关于iphone - 在后台运行 iOS 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8728109/

相关文章:

iphone - 复制到通用粘贴板

ios - XCode 5 - 使图像像按钮一样可点击

swift - 即使应用程序关闭,每月编译用户数据的最佳方法

ios - 警告文本字段中的大写 [仅第一个字]

ios - 添加和删​​除接口(interface)类后 iPhone 应用程序崩溃

iphone - 如何在 UISearchBar 中创建两个输入文本字段

iphone - 为什么 MPMoviePlayerController 只在 iPhone 中显示这些消息?

iphone - viewDidLoad 处的文本左对齐,而不是使用自定义字体居中

iphone - 如何在iOS 6中的后台播放音频文件?

ios - 如何检查 JSON 对象不为空?