闲置计时器时间到期后,应用程式未进入休眠状态

编程入门 行业动态 更新时间:2024-10-14 00:30:40
本文介绍了闲置计时器时间到期后,应用程式未进入休眠状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

据我了解,idleTimerDisabled设置被设置为默认值NO.虽然,当我运行我的应用程序并等待其超时并进入睡眠状态时,它并没有超时,也没有处于睡眠状态.

From what I understand the idleTimerDisabled setting is set to a default of NO. Although, when I run my app and wait for it to time out and sleep, it's not timing out and it's not sleeping.

我进入我的AppDelegate并将其手动设置为NO,以试图使其进入睡眠状态,但仍然没有运气.我正在使用下面的代码...

I've gone into my AppDelegate and set it to NO manually to try to force it to sleep but still no luck. I'm using the code below...

[UIApplication sharedApplication].idleTimerDisabled = NO;

是否有任何可能的想法?

Any thoughts about why this might be happening?

推荐答案

从iOS设备本身而不是XCode调试器运行应用程序.调试器将不允许设备进入睡眠状态,因为您正在调试;)

Run the app from the iOS device itself, not from the XCode debugger. The debugger will not allow the device to go to sleep because you're, well, debugging ;)

更多推荐

闲置计时器时间到期后,应用程式未进入休眠状态

本文发布于:2023-11-27 23:22:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640011.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计时器   程式   期后   状态   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!