Re: Stupid newbie question
Re: Stupid newbie question
- Subject: Re: Stupid newbie question
- From: "Erik M. Buck" <email@hidden>
- Date: Tue, 30 Oct 2001 10:42:30 -0600
>
Hello.
>
>
Here is the stupid question of the week:
>
>
Let's say that I have an object in one nib file and another object in
>
another nib file. I want to create an outlet that connects the first
>
with the second. Is this possible? Is this possible with actions? If so
>
how do I do it?
>
>
Thank you in advance!
>
>
Nick
>
See
http://www.oreilly.com/catalog/learncocoa/apple/ch10.html
About File's Owner
Every nib file has one owner, represented by the File's Owner icon in a nib
file window. The owner is an object, external to the nib file, that relays
messages between the objects unarchived from the nib file and the other
objects in your application.
You specify a file's owner programmatically, in the second argument of
NSBundle's loadNibNamed:owner:. The File's Owner icon in Interface Builder
is a "proxy" object for that owner. Although you can assign owners to this
object in Interface Builder, this doesn't necessarily guarantee anything
about the file's real owner.
In the main nib file, File's Owner always represents NSApp, the global
NSApplication constant. The main nib file is created automatically when you
create an application project; it is loaded when an application is launched.
Nib files other than the main nib file--auxiliary nib files--contain objects
and resources that an application may load only when it needs them (for
example, an Info panel). You must specify the owner of auxiliary nib files.
You can determine or change the class of the current nib file's owner in
Interface Builder by selecting the File's Owner icon in the nib file window
and then displaying the Custom Class Info window. You'll get to practice
this technique when you learn how to create multidocument applications in
Chapter 11, "Cocoa's Multiple-DocumentArchitecture".