NSNotifications getting "lost in the post"
NSNotifications getting "lost in the post"
- Subject: NSNotifications getting "lost in the post"
- From: Nick Forge <email@hidden>
- Date: Fri, 28 Mar 2008 20:46:04 +1100
I've got a project that is exhibiting some incredibly strange
behaviour. A few days ago, my Mac Pro crashed (due to the dreaded
Nvidia driver channel exception issue) while I had Xcode and IB open.
Ever since then, I've been having an issue where certain instances
will not receive certain NSNotifications in this project. The most
glaring example is that my AppController observes
NSWindowWillCloseNotification, and uses it to decide whether or not
the application should quit. Here's the weird part:
If I compile with "Release" configuration, it works as it should, and
the notification fires off the corresponding -aWindowWillClose: method
in my AppController instance.
If I compile with "Debug" config, my AppController instance refuses to
receive NSWindowWillCloseNotifications, if they are coming from an
actual window. If I send my own "NSWindowWillCloseNotification"
programatically, my AppController DOES receive the notification.
So it is listening for it, but for some reason, when I compile in
Debug mode, my NSWindowWillCloseNotifications aren't getting from any
NSWindows to my AppController. Other notifications seem to be "getting
lost" in debug mode as well. In Release mode, everything works 100%
fine.
I thought I'd worked it out, when after many wasted hours and
trawling back through my SVN repository I discovered that replacing
the NIBs with pre-crash versions made the notifications problem go
away. So I figured the NIBs must have been corrupted. I've now re-done
them ALL, by hand, with no copy and paste, so they should be
completely corruption free.... but it's still happening. With a
completely fresh NIB file, (using NIB3 btw), compiling in Debug means
that my AppController instance won't receive messages properly, but in
Release mode it's fine.
I'm ready to tear my hair out right now... it's been 48 hours and I've
done nothing but try and get NSNotifications to be received properly.
Does anyone have any ideas as to what could be going wrong? Is there a
bug in Xcode 3.0 or IB3 that could be giving me grief? Is there a
problem with my OSX or Dev tools install? Is there some obscure config
setting in Debug mode that could potentially send NSNotifications into
the ether?
Thanks in advance,
Nick Forge
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden