title: Changing screen brightness before terminating
body: <p>I have an iOS 5.0 application for which I would like to change the screen brightness just before it terminates. I used:</p>
  
  <pre><code>[[UIScreen mainScreen] setBrightness:0.2];
  </code></pre>
  
  <p>I only have one view. I tried running this in <code>applicationWillTerminate</code>, <code>viewDidUnload</code>, <code>viewWillUnload</code>, <code>viewWillDisappear</code>. I used breakpoints to confirm that the code does indeed get executed, but the screen brightness doesn't change.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>The reason for doing this is that I changed the brightness inside the application and I would like to restore the brightness to what it was before starting the application.</p>