The following line of code prevents the app from automatically locking the screen after some idle time.
[UIApplication sharedApplication].idleTimerDisabled = YES; //write this in applicationDidFinishLaunching
It works well till iOS 5.0. But iOS 5.1 does not respect this line and locks the screen after some idle time. How to solve this irritating issue?
Thanks.
Edit:
The same code works fine when its installed in 5.0.1 device. But I dont know why it is not working with 5.1 device.
[[UIApplication sharedApplication] setIdleTimerDisabled: YES];
worked for me on iOS 5.1