Skip to content

Instantly share code, notes, and snippets.

@cppforlife
Created September 16, 2012 08:09
Show Gist options
  • Save cppforlife/3731520 to your computer and use it in GitHub Desktop.
Save cppforlife/3731520 to your computer and use it in GitHub Desktop.
log all notifications going through NSNotificationCenter
void MyCallBack (CFNotificationCenterRef center,
void *observer,
CFStringRef name,
const void *object,
CFDictionaryRef userInfo)
{
NSLog(@"---\n name: %@\n info: %@", name, userInfo);
}
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), NULL, MyCallBack, NULL, NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment