iPhone – Prevent iPhone Application From Sleeping

By default, there is an idle timer in iPhone such that it will go to sleep mode if it is idle for a period of time.

So if you don’t want your iPhone Application goes to sleep mode automatically, you can disable the idle timer by the following.

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

 

Just add it in the applicationDidFinishLaunching method.

Done =)

Reference: How to prevent the iPhone from sleeping (when running your application)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.