IOKit IOPowerSources 的麻烦
我在使用 IOPowerSources 及其文档时遇到了很大的困难。
我的问题是,我无法弄清楚 IOPowerSources 的该死的导入。我正在阅读:
所需的导入无处可寻,而且它是让我抓狂。有人可以告诉我要导入什么以便我可以开始使用 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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
#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.