Jeremy1026
Mar 25, 2009, 04:08 PM
I am trying to return the battery level of the device. But, no matter what my battery is, it returns 1.0. Here is my code that I am using.
UIDevice *myDevice = [UIDevice currentDevice];
[myDevice setBatteryMonitoringEnabled:YES];
float batLeft = [myDevice batteryLevel];
NSLog(@"%f",batLeft);
UIDevice *myDevice = [UIDevice currentDevice];
[myDevice setBatteryMonitoringEnabled:YES];
float batLeft = [myDevice batteryLevel];
NSLog(@"%f",batLeft);
