闲置计时器时间到期后,应用程式未进入休眠状态 [英] App not sleeping after idleTimer time expires

查看:620
本文介绍了闲置计时器时间到期后,应用程式未进入休眠状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,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 ;)

这篇关于闲置计时器时间到期后,应用程式未进入休眠状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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