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

Presetting instance variables when nib-loading


  • Subject: Presetting instance variables when nib-loading
  • From: Gwynne <email@hidden>
  • Date: Fri, 26 Mar 2004 03:07:38 -0500

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.


  • Follow-Ups:
    • Re: Presetting instance variables when nib-loading
      • From: Bob Smith <email@hidden>
  • Prev by Date: NSButtonCell drawing
  • Next by Date: Completely resizing NSImage
  • Previous by thread: NSButtonCell drawing
  • Next by thread: Re: Presetting instance variables when nib-loading
  • Index(es):
    • Date
    • Thread