Re: initializing a Window Controller
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.