views:

293

answers:

1

I'm trying to set the backlight display from a plist value, but I keep getting an error! So I guess my question is how can I convert a plist value to a float value so I can set the backlight form the plist entry?

The Code:

float customBacklight = (float)[[plistDict floatForKey:@"Backlight Level"] floatValue];
GSEventSetBacklightLevel(customBacklight);

The Error:

reason: '*** -[NSCFDictionary floatForKey:]: unrecognized selector sent to instance 0x15695c0'

Everything works fine, values are correct, Private API's are setup correctly, just cant seem to convert the plist value to a float value. This is not for an AppStore release either.

A: 
float customBacklight = [[plistDict valueForKey:@"Backlight Level"] floatValue];
coneybeare
I've tried that one too, gives me the same error!
AWright4911
Well, not for some reason it works using this method, thanks.
AWright4911