Guest User

Untitled

a guest
Oct 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #define listenToNotification$withCallBack(notification, callback) \
  2. CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), \
  3. self, \
  4. &callback, \
  5. CFSTR(notification), \
  6. NULL, \
  7. CFNotificationSuspensionBehaviorHold);
  8.  
  9. //example:
  10. listenToNotification$withCallBack("com.homeschooldev.enabledswitch", &callback)
  11. static void callback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
  12.  
  13. }
Add Comment
Please, Sign In to add comment