以编程方式获取电池充电信息 [英] Get Battery Charge Information Programmatically

查看:105
本文介绍了以编程方式获取电池充电信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(Xcode 6,OSX 10.10.3)如何以编程方式获取 Mac 的电池电量信息(充电状态、电池电量、循环次数、最大电量(以 mAH 为单位)?

(Xcode 6, OSX 10.10.3) How do I get the battery charge information of a Mac (Charge Status, Battery level, Cycle count, Maximum charge in mAH) programmatically?

推荐答案

希望对您有所帮助:

  1. 它使用未经批准的调用,因此请勿使用此代码发布您的申请,否则您可能会被拒绝!

  1. It uses non-approved calls, so don’t post your application with this code or you may be rejected!

http://blog.coriolis.ch/2009/02/14/reading-the-battery-level-programmatically/

来自苹果;所以不要担心这个代码:https://developer.apple.com/library/ios/samplecode/BatteryStatus/Introduction/Intro.html(附完整示例代码)

From Apple; so don't worry about this code: https://developer.apple.com/library/ios/samplecode/BatteryStatus/Introduction/Intro.html (With complete sample code)

这篇关于以编程方式获取电池充电信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆