gpt4 book ai didi

iphone - 关闭ios应用程序后如何使进程仍在运行

转载 作者:行者123 更新时间:2023-11-28 22:52:33 26 4
gpt4 key购买 nike

我现在正在 iPhone 上开发一个应用程序。应用程序中有一个功能,我用它来定期从服务器端更新一些信息。

当我关闭应用程序时,是否有任何方法可以使更新过程保持运行(在内存中的某个位置左右)?然后重启应用能恢复信息吗?

最佳答案

如果你的意思是:

Is it possible to keep running code if the user kill my app ?

那么答案是

但是如果你的意思是:

Is it possible to keep running code while my app is in background ?

然后您可以使用 UIBackgroundTaskIdentifier(文档 here)。

This post解释得很好

关于iphone - 关闭ios应用程序后如何使进程仍在运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11590350/

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