I am using this in my appdelegate\'s applicationDidFinishLaunching: method to make sure the iPhone doesn\'t go to sleep during the time the app is open
[appl
I think the setIdleTimerDisabled doesn't exist in UIApplication class. Property searches not only set- method but also other similar named methods.
Use dot accessor is the best way to solve your problem.
i had the same problem. i need to make the screen dim, but when turn off the camera, the iphone goes to sleep.
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[UIApplication sharedApplication] setIdleTimerDisabled:NO];
}
Then i call it after turn on/off the camera, it works.
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
I set and un-set this property throughout my app using:
[UIApplication sharedApplication].idleTimerDisabled = YES;
Setting this where you're having trouble could fix it, though it might be a bit of a band-aid solution.