Created
October 16, 2013 15:57
-
-
Save breeno/7010222 to your computer and use it in GitHub Desktop.
Hooking NSNotificationCenter to trace all messages. Useful stuff!
This file contains hidden or 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(CFNotificationCenterGetLocalCenter(), | |
NULL, | |
notificationCenterHookProc, | |
NULL, | |
NULL, | |
CFNotificationSuspensionBehaviorDeliverImmediately); | |
void notificationCenterHookProc (CFNotificationCenterRef center, | |
void *observer, | |
CFStringRef name, | |
const void *object, | |
CFDictionaryRef userInfo) | |
{ | |
NSLog(@"name: %@ userInfo:%@", name, userInfo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment