I am writing a music player that I am trying to allow to go to sleep mode. The problem is, every second, the ui is updated and I think that is preventing the phone from sleep. I added this line:
[UIApplication sharedApplication].idleTimerDisabled = NO;
and it did nothing. I have seen other apps that go to sleep mode even if the ui is being updated. How can I accomplish this?
Based on the comments, Are you running your app while attached to Xcode
? By default Xcode
stops the device going to sleep. If so, just disconnect and run, it should go to sleep (provided your devices sleep timer is not too much)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With