For some better understanding on what happens “under the hood”, I would love to do a complete trace of any notifications happening within my application.
Naïve as I
For debugging purposes, I find that a breakpoint is actually better than adding code to the project. However, @Till's solution didn't seem to work for me. I found another solution online, and tweaked it a bit.
Symbolic Breakpoint
- Symbol:
-[NSNotificationCenter postNotificationName:object:userInfo:]
- Condition:
((NSRange)[$arg3 rangeOfString:@"^(_|NS|UI)" options:1024]).length == 0
- Action: Debugger Command
po $arg3
- Automatically continue after evaluating actions
Notes:
_
, NS
, or UI
from being displayed.1024
refers to NSRegularExpressionSearch, which doesn't seem to be available for that breakpoint..length == 0
instead of .location == NSNotFound
because NSNotFound
seems to evaluate to a different value (-1
or (NSUInteger)18446744073709551615
) than the returned value in this breakpoint (9223372036854775807
).