Re: debugging hard-to-locate error in NSApplication delegate
Re: debugging hard-to-locate error in NSApplication delegate
- Subject: Re: debugging hard-to-locate error in NSApplication delegate
- From: Keary Suska <email@hidden>
- Date: Mon, 12 Jan 2009 17:40:33 -0700
On Jan 12, 2009, at 11:41 AM, Quincey Morris wrote:
- (void) init
{
[super init];
applicationHasStarted = NO;
if (![[NSApplication sharedApplication] delegate]) {
[[NSApplication sharedApplication] setDelegate:self];
}
}
This isn't going to work because your app delegate object is in your
NIB file and is (re)created at startup by unarchiving. Therefore,
'initWithCoder' will be called instead or 'init'.
I don't think this is precisely true, particularly for regular objects
(the plain blue cube). At least, none of mine behave this way. Of
course, none of the objects I use in this way implement NSCoding, and
maybe that matters. All other non-view objects do instantiate with
initWithCoder:, as I understand, just not generic custom objects.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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