Re: MyDocument's Window Outlet...
Re: MyDocument's Window Outlet...
- Subject: Re: MyDocument's Window Outlet...
- From: "Kyle Sluder" <email@hidden>
- Date: Wed, 12 Nov 2008 17:36:44 -0500
On Wed, Nov 12, 2008 at 1:22 PM, Jean-Nicolas Jolivet
<email@hidden> wrote:
> What's the use of this outlet if I can't access
> it in my code?
It's there for the default NSDocument machinery to set up an
NSWindowController for you. If you override -[NSDocument
windowNibName], then NSDocument will create a normal
NSWindowController and attach it to your document. In order to
configure the window controller NSDocument needs to know which window
inside the nib is your document's window. This window outlet is
analogous to NSWindowController's (public) window outlet.
This is a setup-time convenience only; the framework is designed so
that you access your document's windows through its -windowControllers
collection, but to spare you from having to implement the same
boilerplate code over and over again in -makeWindowControllers, it
uses the private window outlet to set up the common case of a single
NSWindowController loading a nib.
HTH,
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden