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)