• 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: initializing a Window Controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initializing a Window Controller


  • Subject: Re: initializing a Window Controller
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 17 Feb 2004 20:45:23 -0500

On Feb 17, 2004, at 7:42 PM, Dustin Voss wrote:
Windows are usually populated in an method called -awakeFromNib. -awakeFromNib is called while loading the NIB, after all outlets have been connected. -init is called before the outlets are connected, which is why it didn't work.

Really, though, you shouldn't "populate" windows in -awakeFromNib. You should use -awakeFromNib to finish wiring up things that you started wiring up in the nib file. A good example is the doubleAction of an NSTableView; there's no way to set this in Interface Builder, so you set it in -awakeFromNib.

Instead, to actually populate a window with data -- assuming you aren't using Cocoa Bindings -- you should override -windowControllerDidLoadNib: in your custom NSDocument subclass, or you should override -windowDidLoad in your custom NSWindowController subclass depending on whether or not you're creating a document-based application.

-- Chris

--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
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: 
 >initializing a Window Controller (From: Robb Bean <email@hidden>)
 >Re: initializing a Window Controller (From: Dustin Voss <email@hidden>)

  • Prev by Date: Re: MORE: Setting hierarchy of NIB items
  • Next by Date: Re: display an image in a button
  • Previous by thread: Re: initializing a Window Controller
  • Next by thread: Using Java and Objective-C from same app
  • Index(es):
    • Date
    • Thread