简体   繁体   中英

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. Programmatically, I try to prevent screen lock by setting

[[UIApplication sharedApplication] setIdleTimerDisabled: YES];

after a while when I call:

[[UIApplication sharedApplication] setIdleTimerDisabled: NO];

It doesn't work on iPhone (won't go idle and shut off screen) but iPad seems fine. Strange?

Thanks for your time.

Bummer, here's the reason that I just found - it works once you disconnect the device from XCode. XCode debugging is the culprit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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