Aug 31
Depending on the application we are developing, might be interesting or even needed that the iPhone doesn’t autolock while our application is running. We are lucky as there is an easy why to do this and it only needs one instrucction.
[UIApplication sharedApplication].idleTimerDisabled = YES;
That is all we need so the iPhone stays all the time with the screen on, a good place to put it is in the applicationDidFinishLaunch: in our UIApplication delegate.
Be careful though cause if the user runs away from the iPhone from long times it will empty its battery as it will have the display all the time on.