Re: Bypassing Interface Builder
Re: Bypassing Interface Builder
- Subject: Re: Bypassing Interface Builder
- From: "Shawn Erickson" <email@hidden>
- Date: Thu, 15 May 2008 13:20:47 -0700
On Thu, May 15, 2008 at 1:11 PM, Johnny Lundy <email@hidden> wrote:
> OK - I am getting a lot of education here. I am not a total n00b with Cocoa,
> and have been studying it and coding it for six years, but I realize that a
> lot of stuff I memorized how to do, I never understood what I was doing.
>
>
> On May 15, 2008, at 3:06 PM, email@hidden wrote:
>
>>>
>>> Right. I can understand that, that the owner is the shared
>>> application instance. But why do people bind nib objects to File's
>>> Owner?
>>
>> Well, in the case of the application object you generally don't do
>> that. But in the case of an NSDocument-based application or an
>> NSWindowController subclass, both of which load their own NIBs, the
>> file's owner is the instance of your NSDocument
>
> Ah - HAH!!!! That's the answer!
>
> These tutorials that say to make a document-based app and don't say why they
> say that (there are no "documents" in their apps) are doing it ****so they
> can connect to File's Owner****.
>
> This is why I could not figure out what connecting to File's Owner had to do
> with being able to bind a controller to a model object. It's because my app
> is not a document-based app.
Note the file's owner is not related to having a "document-based"
application nor is it a requirement. File owner is simply a way to
connect objects instantiated in the nib with the object that loads
otherwise owns the nib.
"File's Owner. An object that owns the nib file and manages the
objects within it. The File's Owner must be external to the nib file.
You use the File's Owner object as the conduit for connections between
objects in the nib file and objects outside of it."
-Shawn
_______________________________________________
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