init code in ApplicationNotifications/awakeFromNib
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.