Skip to content

Instantly share code, notes, and snippets.

@zhangkn
Created May 14, 2018 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangkn/74a599e16e2680d03f07baecb15d782b to your computer and use it in GitHub Desktop.
Save zhangkn/74a599e16e2680d03f07baecb15d782b to your computer and use it in GitHub Desktop.
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
NULL,
(CFNotificationCallback)ChangeCallBack,
(CFStringRef)kASDarwinNotifyChange,
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
static void ChangeCallBack() {
reload();
}
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