• 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: awakeFromNib not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: awakeFromNib not called


  • Subject: Re: awakeFromNib not called
  • From: James Spencer <email@hidden>
  • Date: Tue, 11 Oct 2005 19:46:03 -0500


On Oct 11, 2005, at 12:02 PM, Paul J. Lucas wrote:

On Tue, 11 Oct 2005, Paul Bennett wrote:


The documentation is referring to the class of the File's Owner
itself. (In Interface Builder, select the File's Owner and pick
'Custom Class' from the Inspector (Cmd-5). That class there (probably
NSApplication if you've just created a simple Cocoa Application) is
the one whose -awakeFromNib will be called.


If I try to change it to my custom class Foo, I get an alert that asks, "Do you want to change the file owner to a class that does not inherit from NSApplication?"

Do I?

That's hard to answer but probably not. The file's owner is usually a member of the class that loads the nib. How are you loading the nib? If you are just letting the app load it, then you probably want to let the app be the file's owner.


When the objects in your Nib (e.g. controls, windows and custom objects that
you have instantiated) are deserialised from the Nib, then *their*
-awakeFromNib methods will be called.



I get that part.


It sounds very much as if no instance Foo class is loading the Nib, and no
instance is contained within the Nib. Hence, Foo's -awakeFromNib is not being
called.



I did explicitly select "Instantiate Foo" from the Classes menu.

And do you see an instance of Foo in the Instances pane? If so and if your -awakeFromNib is still not being called, it would tend to indicate that the nib file is not being loaded. On the other hand, going back to my question above, if you are calling something like


Foo *myFoo = [[Foo alloc]init];

then -awakeFromNib won't be called even if you have an instance in the nib file because that doesn't load the nib file.

Spence

James P. Spencer
Rochester, MN

email@hidden

"Badges??  We don't need no stinkin badges!"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: awakeFromNib not called
      • From: "Paul J. Lucas" <email@hidden>
References: 
 >awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)
 >Re: awakeFromNib not called (From: j o a r <email@hidden>)
 >Re: awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)
 >Re: awakeFromNib not called (From: Paul Bennett <email@hidden>)
 >Re: awakeFromNib not called (From: "Paul J. Lucas" <email@hidden>)

  • Prev by Date: Re: Spotlight view
  • Next by Date: Re: NSPanel without window border decoration
  • Previous by thread: Re: awakeFromNib not called
  • Next by thread: Re: awakeFromNib not called
  • Index(es):
    • Date
    • Thread