I have an iOS 5.0 application for which I would like to change the screen brightness just before it terminates. I used:
[[UIScreen mainScreen] setBrightness:0.2];
I only have one view. I tried running this in applicationWillTerminate, viewDidUnload, viewWillUnload, viewWillDisappear. I used breakpoints to confirm that the code does indeed get executed, but the screen brightness doesn’t change.
What am I doing wrong?
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.
Looks like this might be a bug:
https://devforums.apple.com/message/625119