I searched around for a way to set the backlight level within an app on the iPhone. I found a solution here:
http://www.iphonedevsdk.com/forum/29097-post3.html
T
The reason you are getting a warning is because GSEventSetBacklightLevel()
is a private API not declared in any of of the SDK headers. If you are planning to submit this to the app store your app will get rejected if you call it. If this is for a jailbroken device, you can just declare the function yourself.
void GSEventSetBacklightLevel(float level);
The reason you are getting the error is because you are trying to assign a float (which is a scalar) to an NSNumber *
. You probably want to change previousBacklightLevel to be a float.
you can add the private framework by jus drag and drop to your xcode project from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework and also import the #import "GraphicsServices.h"
header in your .h file