据我了解,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 ;)
更多推荐
闲置计时器时间到期后,应用程式未进入休眠状态
发布评论