简体   繁体   English

iPhone setIdleTimerDisabled无法关闭

[英]iPhone setIdleTimerDisabled can't be turned off

iOS developers, has anybody seen what I've recently seen: I'm building an universal app on iPhone and iPad. iOS开发人员,有谁看过我最近看到的内容:我正在iPhone和iPad上构建通用应用程序。 Programmatically, I try to prevent screen lock by setting 我以编程方式尝试通过设置来防止屏幕锁定

[[UIApplication sharedApplication] setIdleTimerDisabled: YES]; [[UIApplication sharedApplication] setIdleTimerDisabled:是];

after a while when I call: 过一会儿,我打电话给:

[[UIApplication sharedApplication] setIdleTimerDisabled: NO]; [[UIApplication sharedApplication] setIdleTimerDisabled:否];

It doesn't work on iPhone (won't go idle and shut off screen) but iPad seems fine. 它在iPhone上不起作用(不会闲置并关闭屏幕),但iPad看起来不错。 Strange? 奇怪?

Thanks for your time. 谢谢你的时间。

Bummer, here's the reason that I just found - it works once you disconnect the device from XCode. Bummer,这就是我刚刚发现的原因-一旦您将设备与XCode断开连接,它就会起作用。 XCode debugging is the culprit. XCode调试是罪魁祸首。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM