Getting numbers from CFDictionary for use in calculations, iPhone

I found this on my travels:

http://www.opensource.apple.com/source/IOKitUser/IOKitUser-502/ps.subproj/IOPSKeys.h

How do I get the values ​​(as a number):

#define kIOPSMaxCapacityKey "Max Capacity"

and

#define kIOPSDesignCapacityKey "DesignCapacity"

I want to use them throughout the application. What do I need to add to my project and how to extract numbers?

Many thanks,

Stewart

0
source share
1 answer

Once you find out where the real dictionary is, it stores these values, you can access the value from the dictionary using the following call:

CFDictionaryGetValue (
   CFDictionaryRef theDict,
   const void *key
);

http://www.opensource.apple.com/source/IOKitUser/IOKitUser-502/ps.subproj/, , , / , , , ( CFNumbers, CFDictionaryGetValue CFNumber.

+1

All Articles