• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: debugging hard-to-locate error in NSApplication delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: debugging hard-to-locate error in NSApplication delegate
      • From: Quincey Morris <email@hidden>
References: 
 >debugging hard-to-locate error in NSApplication delegate (From: Greg Beaver <email@hidden>)
 >Re: debugging hard-to-locate error in NSApplication delegate (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: @loader_path and @executable_path
  • Next by Date: Re: Disabled button looks like enabled
  • Previous by thread: [SOLVED] Re: debugging hard-to-locate error in NSApplication delegate
  • Next by thread: Re: debugging hard-to-locate error in NSApplication delegate
  • Index(es):
    • Date
    • Thread