iPhone电池容量值(毫安时)

iPhone电池容量值(毫安时),iphone,battery,iokit,uidevice,Iphone,Battery,Iokit,Uidevice,我想知道如何在Mha中为iPhone/iPad电池提供数据容量。 我会把它们放在我打算放在appstore上的应用程序中,然后我就不能使用IOKit了。 有人知道我如何获得这些值吗 batteryLevel The battery charge level for the device. @property (nonatomic, readonly) float batteryLevel Discussion Battery level ranges from 0.0 (fully disc

我想知道如何在Mha中为iPhone/iPad电池提供数据容量。 我会把它们放在我打算放在appstore上的应用程序中,然后我就不能使用IOKit了。 有人知道我如何获得这些值吗

batteryLevel

The battery charge level for the device.
@property (nonatomic, readonly) float batteryLevel
Discussion

Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.

If battery monitoring is not enabled, battery state is UIDeviceBatteryStateUnknown and the value of this property is –1.0.
Availability

    Available in iOS 3.0 and later.

See Also

      @property batteryState
      @property batteryMonitoringEnabled

Declared In
UIDevice.h

然后你可以在你的应用程序中添加一个plist,你可以在其中输入每个设备的所有电池容量,读取设备型号,通过电池百分比和满容量,你可以得到以毫安时为单位的实际值

你是说毫安时(毫安时)