Re: how to debug notification that's never received?
Re: how to debug notification that's never received?
- Subject: Re: how to debug notification that's never received?
- From: Matt Neuburg <email@hidden>
- Date: Sat, 04 Mar 2006 17:49:11 -0800
- Thread-topic: how to debug notification that's never received?
On Fri, 03 Mar 2006 13:17:32 -0800, Matt Neuburg <email@hidden> said:
>In class A, I post a notification. I know from logging that the posting code
>is being executed.
>
>In class B, I've registered to receive that notification, but it never
>arrives.
>
>I've double-checked the registration, dicking with the notification name and
>all sorts of things, but I can't make the notification arrive.
>
>In the end, after about two hours of dicking around, I simply threw up my
>hands and solved the problem a different way. I never figured out what the
>problem was! So how might I have debugged this? Is there a way to dig into
>the internals of the notification center and see who is registered to
>receive what, and to find out exactly what happens when the notification is
>posted? m.
I think we may take it as stipulated that I know how to register for and
post a notification and that I've done it zillions of times. The question
was not what might be wrong with my registration or posting code (nothing
was). I did eventually find the problem, but not by using the debugger; I
simply had to read a lot of code, by eye. After some hours, I found some
code that was sneaking in and unregistering me, which is why I didn't
receive the notification when it was posted.
The question was how I might avoid this line-by-line reading, and use the
debugger or some other technique to find the problem. It would have been
nice to be able to probe the notification center itself, e.g. somehow
watching objects get registered and unregistered. It appears, however, that
there is no way to do this. This surprises me greatly; after all, you can
probe KVO with -observationInfo, so why isn't there something similar for
NSNotificationCenter? I've filed a feature request for this. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden