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];
}