Re: Multiple NIBs and -awakeFromNib problems
Re: Multiple NIBs and -awakeFromNib problems
- Subject: Re: Multiple NIBs and -awakeFromNib problems
- From: Henri Lamiraux <email@hidden>
- Date: Mon, 27 Aug 2001 16:48:16 -0700
-awakeFromNib being called on the file's owner is the correct behavior.
You want the file's owner to know that its oultets have been set. Your
problem is that you should not instantiate this controller in your main
nib. NSWindowController are usually created programmatically, passing
the name of the nib to load. Connect your menu item to an action of the
File's owner of your main nib (usually your application object). In this
action create the window controller and call showWindow.
On Monday, August 27, 2001, at 04:24 PM, Jeffrey J Barbose wrote:
>
in my main nib, i have an instance of MyController, a subclass of
>
NSWindowController. I can understand why -awakeFromNib gets called on
>
this controller.
>
>
however, when i choose a menu item calls MyController's -showWindow,
>
MyController's -awakeFromNib gets called AGAIN. Note that
>
MyController is NOT instantiated in the MyController.nib file, but
>
MyController set as the File's Owner's class, as is required.
>
Henri Lamiraux
Engineering Manager
User Interface Tools Group
Apple