• 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: Presetting instance variables when nib-loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Presetting instance variables when nib-loading


  • Subject: Re: Presetting instance variables when nib-loading
  • From: Bob Smith <email@hidden>
  • Date: Mon, 29 Mar 2004 18:39:52 -0800

The controller object's initializer method will be called even when it is being instantiated from a nib, perhaps what you are trying to do in -awakeFromNib or -initWithCoder: really should be in -init.

Bob S.


On Mar 26, 2004, at 12:07 AM, Gwynne wrote:

I have a (non-document-based) application whose main controller needs to have an instance variable set before -awakeFromNib is called. Right now I'm doing this by implementing -initWithCoder:, setting the variable, and returning self without doing anything else. It seems to work, but I'd like to know if this is the best way. The variable is not an outlet and can't be set from IB.

Alternatively, is there any way to prevent -awakeFromNib from being called on the controller being awoken as the File Owner in a secondary nib? The idea here is to prevent -awakeFromNib from being executed more than once, without having to implement an entire separate controller class for the one outlet and one method the sheet I'm loading needs. I could put the sheet in the main nib, but Apple keeps telling us not to put more than one window into one nib. Thoughts?

-- Gwynne, key to the Code that runs us all
Formerly known as Sailor Quasar.
Email: email@hidden
Web: http://musicimage.plasticchicken.com/
_______________________________________________
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.


References: 
 >Presetting instance variables when nib-loading (From: Gwynne <email@hidden>)

  • Prev by Date: Programatically creating scroll view
  • Next by Date: Re: Selecting only Rows (and not columns) in a TableView?
  • Previous by thread: Presetting instance variables when nib-loading
  • Next by thread: RE: Presetting instance variables when nib-loading
  • Index(es):
    • Date
    • Thread