If you have an application that requires the iPhone from going to sleep when the user is not touching the screen or otherwise interacting with the iPhone, you need to disable the idle timer.
This is very easily done in code, but remember, it does use up more battery life, so the idle timer should only be disabled when it’s absolutely necessary!!
The code can be put in a variety of places, but I would recommend placing it in the ProjectNameAppDelegate.m file, inside the applicationDidFinishLaunching method as follows;
-(void)applicationDidFinishLaunching:(UIApplication *)application
{
//Code to stop the iPhone from sleeping
[[ UIApplication sharedApplication ] setIdleTimerDisabled: YES ];
}
Don’t forget that this will drain the battery more, so use it only when it’s essential!
Happy coding!
Cheers
Graham
Cool, Thanks.
Cool work, hope to hear more from you.Are you working in a Group that you can make such a cool Blog?