gpt4 book ai didi

iphone - 发生中断怎么办

转载 作者:行者123 更新时间:2023-11-28 23:06:20 24 4
gpt4 key购买 nike

我正在使用 NSURLConnection 异步地对我的数据库进行大量查询,我已经阅读了一些关于苹果文档的内容,如下所示。但是,如果中断发生并且是希望有人能帮助我了解正在发生的事情以及我的责任为何。

Apple 文档将这些事情列为在发生中断时要处理/考虑的事情。

What to Do When an Interruption Occurs

Alert-based interruptions result in a temporary loss of control by your app. Your app continues to run in the foreground, but it does not receive touch events from the system. (It does continue to receive notifications and other types of events, such as accelerometer events, though.) In response to this change, your app should do the following in its applicationWillResignActive: method:

Stop timers and other periodic tasks. Stop any running metadata queries. Do not initiate any new tasks. Pause movie playback (except when playing back over AirPlay). Enter into a pause state if your app is a game. Throttle back OpenGL ES frame rates. Suspend any dispatch queues or operation queues executing non-critical code. (You can continue processing network requests and other time-sensitive background tasks while inactive.)

最佳答案

最后一句话说明了一切:您可以在不活动时继续处理网络请求。

关于iphone - 发生中断怎么办,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9255310/

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