How-To: Stop iPhone going into sleep mode (iPhone SDK)
Dec.06, 2008 in
Tech
The iPhone OS will attempt to save battery power by using its automatic sleep timing function. If the system doesn’t detect any ‘touches’ it will dim the screen and eventually turn it off.
Sometimes you don’t want this to occur – if you are creating a game or application that uses the accelerometer for instance. To turn off the timer, you need to set the idleTimerDisabled property to YES on the UIApplication object.
For example:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
application.idleTimerDisabled = YES;
[window addSubview:[rootViewController view]];
[window makeKeyAndVisible];
}

December 5th, 2009 at 5:14 am
Thanks for this tip.
Is there a way of disabling sleep but turning turning the screen off to get periodic location events?