Re: awakeFromNib and windowWillLoad : basic question
Re: awakeFromNib and windowWillLoad : basic question
- Subject: Re: awakeFromNib and windowWillLoad : basic question
- From: jean Bousquet <email@hidden>
- Date: Fri, 04 Jul 2003 10:57:27 +0200
Thanks Ben,
I just wanted to clarify in my mind the differences between the 2 methods :
awakeFromNib and windowWillLoad used in a WindowController, that is why I
used both just to see when (in which order) there were invoked.
It appeared that in the case of a WindowController in the MainMenu.nib which
is connected to a window which is automatically displayed at launching time,
windowWillLoad is not invoked.
From the Aaron Hillegass's book "Cocoa programming with Mac OSX" p151 is
quoted :
"After the nib file is loaded, the
Controller will be sent windowDidLoad.
This is an opportunity (like awakeFromNib
) for the controller object to
initialize the UI objects
"
But the context in the Aaron's book is different from mine. In his case his
window is not in the MainMenu.nib and not loaded at launch time but by
another object on demand. In that last case windowDidLoad is really invoked.
I would like to know for sure if I made a mistake or if there is an
explanation for windowDidLoad not to be invoked.
Jean
>
De : Ben Dougall <email@hidden>
>
Date : Fri, 4 Jul 2003 00:34:39 +0100
>
@ : jean Bousquet <email@hidden>
>
Cc : <email@hidden>
>
Objet : Re: awakeFromNib and windowWillLoad : basic question
>
>
could this because awakeFromNib and windowDidLoad are both used to do
>
the same thing? what i mean is, that you use one or the other - they're
>
2 of the same kind? i'm making a complete guess seeing as no one else
>
has answered.
>
>
>
On Thursday, July 3, 2003, at 04:48 pm, jean Bousquet wrote:
>
>
> Hello,
>
> Here a basic question from a newbie to understand when awakeFromNib and
>
> windowWillLoad are triggered.
>
> In the mainMenu.nib is a window which is the main window of the appli.
>
> In
>
> its windowController subclass I wrote the 2 methods :
>
> -(void)awakeFromNib
>
> {
>
> NSLog(@"awakeFromNib");
>
> }
>
>
>
> -(void)windowDidLoad
>
> {
>
> NSLog(@"windowDidLoad");
>
> }
>
>
>
> just to see when these methods are triggered.
>
> awakeFromNib is triggered at launch time which seems normal but
>
> windowDidLoad is never triggered although the window is correctly
>
> displayed
>
> on screen at launch time.
>
> Did you think I made some thing wrong or is it normal windowWillLoad
>
> is not
>
> triggered in this situation ? Facing the last case I browsed the doc
>
> but
>
> could not understand why windowWillLoad is not invoked.
>
> May be some body could help ?
>
> Thanks
>
> Jean
>
> _______________________________________________
>
> 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.
_______________________________________________
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.