Re: Posting NSApplicationDidFinishLaunchingNotification fails, Application crashes on Intel Macs
Re: Posting NSApplicationDidFinishLaunchingNotification fails, Application crashes on Intel Macs
- Subject: Re: Posting NSApplicationDidFinishLaunchingNotification fails, Application crashes on Intel Macs
- From: "Paolo Manna" <email@hidden>
- Date: Tue, 31 Jul 2007 23:33:11 +0100
On 31/07/07, Stefan Heukamp <email@hidden> wrote:
> > That sounds strange: the notification is the argument of
> > applicationDidFinishLaunching:, so it's usually posted by
> > finishLaunching just before, not after, and the call to the delegate
> > is the standard response. Are you sure you let your delegate be called
> > properly?
> I've got a NSLog() in the delegate method and in the method that is
> called by the notification (that i registered just for debugging
> purposes). So I can see that the notification is surely called after the
> delegate method.
No: terms aren't quite right (a NSNotification is 'posted', it's the
NSNotificationCenter that in turn 'calls' the registered selectors,
one after the other), if the method you register is called later than
the delegate it doesn't mean the NSNotification hasn't been posted
earlier, it just means your selector comes later in
NSNotificationCenter's internal order.
> I know that, but I'am pretty sure you do not like to review all the code
> of my application. And I just don't know which code to paste because as
> far as I see the bad access does not happen in my code.
Thinking a bit more about it, I'm now pretty much convinced that it is
indeed something that happens in your code, in the
applicationDidFinishLaunching: (that you stated is quite complex). The
fact that you see the crash in the NSNotification code means probably
that you're leaving the stack (or, as someone else was suggesting, one
of the objects you've used) in a bad state, so that the crash happens
when you're just out of your code, but still in the
NSNotificationCenter code that has called the delegate.
It probably doesn't show on PPC because a corrupted stack is likely to
look different on different processors...
Again, trying to guess on the few data available!
Paolo
_______________________________________________
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