Georges Oates Larsen
Georges Oates Larsen

Reputation: 7102

IOKit IOPowerSources troubles

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 :)

Upvotes: 3

Views: 1695

Answers (1)

Rob Keniger
Rob Keniger

Reputation: 46020

#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.

Upvotes: 8

Related Questions