2013-10-05 53 views

回答

1

需要兩個功能:

CFRunLoopSourceRef IOPSNotificationCreateRunLoopSource(IOPowerSourceCallbackType callback, void *context); 
// to subscrive to a notification of a power source being changed 

CFTypeRef IOPSCopyPowerSourcesInfo(void); 
// to get info about your current power source 

兩者都描述如下:IOPowerSource

我不知道是不是要在後臺模式或不工作,但你可以試試。