disable automatic locking on iphone with iOS 4.3.3

4.4k views Asked by At

I want to disable the auto lock on my iOS4.3.3 program. I found on the web the same answer several times for this and working for xcode3 but I cant find it to work with mine.. help pls? thks

2

There are 2 answers

3
Robin Summerhill On BEST ANSWER

This should work on iOS 4.3.3. If not then you're doing something wrong:

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
1
orkoden On

I did it in a ViewController like this.

-(void) viewDidAppear:(BOOL)animated
{
    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}

-(void) viewDidDisappear:(BOOL)animated
{
    [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}