当 iPhone 进入待机模式时,iPhone 应用程序会发生什么? [英] What happens to an iPhone app when iPhone goes into stand-by mode?

查看:21
本文介绍了当 iPhone 进入待机模式时,iPhone 应用程序会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用 NSTimer,当 iPhone 进入待机模式(通过按下硬件按钮或空闲计时器)时,NSTimer 似乎不会触发.

My app uses NSTimer and it appears that NSTimer doesn't fire when the iPhone goes into the stand-by mode (either by pressing the hardware button or by the idle timer).

当我再次激活 iPhone 时,我的应用程序仍处于前台.当 iPhone 处于待机模式时,第三方应用会怎样?

When I activate the iPhone again, my app is still in the foreground. What happens to third party apps when the iPhone is the stand-by mode?

推荐答案

虽然这里不明显,但我相信原发帖者确实通过发起一个线程找到了他问题的答案(此处提供)在 iPhone 开发者论坛中(我最终不得不找到自己,因为这里没有共享信息).

Although it's not evident here, I believe the original poster did find an answer to his question by starting a thread (available here) in the iPhone Developer Forums (which I eventually had to find myself because the information wasn't shared here).

如果其他人有同样的问题并在将来找到该页面,这里有一个有用的回复,该回复由 Apple 论坛上名为eskimo1"的人发布(我对其进行了轻微编辑,以便在没有具有整个原始线程提供的上下文):

In case someone else has the same question and finds the page in the future, here's a helpful response that was posted by someone on the Apple forum called "eskimo1" (which I have edited slightly such that it is easier to read without having the context provided by the entire original thread):

  • 关于 iPhone 应用程序状态术语,活动"并不意味着唤醒",它意味着附加到 GUI".想想它类似于 Mac OS X 中的最前面".当您锁定设备时,您的应用会停用,但设备可能会也可能不会进入睡眠状态
  • 如果设备连接到主电源(即通过 USB),iPhone 操作系统很少进入睡眠状态.但是,如果使用电池运行,它可以休眠.
  • 屏幕锁定后不久(Oliver Drobnik 称 20 秒),设备进入休眠状态.这就像合上笔记本电脑的盖子一样;主 CPU 上的所有活动都停止.
  • 如果设备在正确的音频会话中播放音频,则不会发生这种情况.请参阅 DTS Q&A QA1626音频会话 - 确保在屏幕显示时继续播放音频锁定"了解详情.
  • 请注意, idleTimerDisabled 属性(可以打开以防止屏幕在应用运行时关闭)在用户不活动后锁定屏幕.它与系统睡眠没有直接关系(间接相关,因为系统可能在锁定后不久进入睡眠状态).

这篇关于当 iPhone 进入待机模式时,iPhone 应用程序会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆