How to determine which NSNotification is crashing due to dealloc-ed observer How to determine which NSNotification is crashing due to dealloc-ed observer objective-c objective-c

How to determine which NSNotification is crashing due to dealloc-ed observer


You can set a symbolic breakpoint in -[NSNotificationCenter postNotificationName:object:userInfo:] and print the third argument passed to it (the first being the NSNotificationCenter, the second, _cmd) using the debugger po command.


Another way to determine this is to get the name parameter value (the string you passed for posting the notification) and verify that any object that is observing that string/name is set to remove observation sometime in the objects lifecycle or as it is deallocating.