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.

VN:F [1.9.8_1114]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.8_1114]
Rating: +2 (from 2 votes)
Stopping autolock in our app, 5.0 out of 5 based on 1 rating

Leave a Reply

You must be logged in to post a comment.

preload preload preload