• 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
init code in ApplicationNotifications/awakeFromNib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

init code in ApplicationNotifications/awakeFromNib


  • Subject: init code in ApplicationNotifications/awakeFromNib
  • From: Robert Tillyard <email@hidden>
  • Date: Tue, 17 Sep 2002 23:02:12 +0100

I have an application with two NIB's and I appear to get an
awakeFromNib twice once when MainMenu.nib loads and again when my
AboutPanel.nib loads.

I have some initialisation I want to do when the application is up and
awakeFromNib does it twice so in Chapter 7 (page 231) of the Simson
Garfinkel & Michael Mahoney book there is what looks like a solution to
use applicationDidFinishLaunching.

The example says put this in Controller.m

> @implementation Controller(ApplicationNotifications)
>
> - (void)applicationDidFinishLaunching:(NSNotification*)notification
> {
> radix = [[radixPopUp selectedItem] tag];
> [self clearall:self]; // Book says clearAll but we don't have one.
> }

and this in Controller.h

>
> @interface Controller(NSApplicationNotifications)
> - (void)applicationDidFinishLaunching:(NSNotification*)notification;
> @end

I put an NSLog() in and notice that this code isn't actually called.

Is there a typo in that one uses NSApplicationNotifications and the
other uses ApplicationNotifications. I did try swapping these around an
my NSLog still doesn't print anything.

Regards. Rob.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: init code in ApplicationNotifications/awakeFromNib
      • From: Robert Tillyard <email@hidden>
  • Prev by Date: NSURL Blocking
  • Next by Date: Re: Toplevel Objects in NIB files
  • Previous by thread: Re: NSURL Blocking
  • Next by thread: Re: init code in ApplicationNotifications/awakeFromNib
  • Index(es):
    • Date
    • Thread