IOKit IOPowerSources 的麻烦

发布于 2024-11-17 09:04:07 字数 412 浏览 3 评论 0原文

我在使用 IOPowerSources 及其文档时遇到了很大的困难。

我的问题是,我无法弄清楚 IOPowerSources 的该死的导入。我正在阅读:

http://developer .apple.com/library/mac/#documentation/Darwin/Reference/IOKit/IOPowerSources_h/index.html

所需的导入无处可寻,而且它是让我抓狂。有人可以告诉我要导入什么以便我可以开始使用 IOPowerSources 吗?谢谢 :)

I am having a REALLY hard time using IOPowerSources, and the documentation along with it.

My issue is that, well, I can't figure out the darned imports for IOPowerSources. I am reading from:

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/IOKit/IOPowerSources_h/index.html

The required imports are NOWHERE to be found, and it's driving me batty. Could someone PLEASE tell me what to import so that I may begin using IOPowerSources? Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

做个少女永远怀春 2024-11-24 09:04:07

#import

您需要将 IOKit 框架添加到您的项目中。您可以在文件列表中展开它并查看其所有标题。

您还可以使用 Xcode 中的快速打开菜单命令打开该函数的头文件。只需开始输入函数名称,Xcode 就会显示匹配的标头及其路径。

我同意你的观点,文档很差,应该告诉你所需的标题。

#import <IOKit/ps/IOPowerSources.h>

You need to add the IOKit framework to your project. You can expand it in the files list and see all its headers.

You can also open the header file for the function by using the Open Quickly menu command in Xcode. Just start typing the function name and Xcode will show you matching headers and their paths.

I agree with you that the documentation is poor and should tell you the required headers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文