Created
May 14, 2018 07:53
-
-
Save zhangkn/74a599e16e2680d03f07baecb15d782b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), | |
NULL, | |
(CFNotificationCallback)ChangeCallBack, | |
(CFStringRef)kASDarwinNotifyChange, | |
NULL, | |
CFNotificationSuspensionBehaviorDeliverImmediately); | |
static void ChangeCallBack() { | |
reload(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), | |
(CFStringRef)kASDarwinNotifyChange, nil, nil, YES); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment