title: Disable automatic screen lock in iOS 5.1
body: <p>The following line of code prevents the app from automatically locking the screen after some idle time.</p>
  
  <pre><code>[UIApplication sharedApplication].idleTimerDisabled = YES; //write this in applicationDidFinishLaunching
  </code></pre>
  
  <p>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?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>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.</p>