Re: File's owner, outlets and methods
Re: File's owner, outlets and methods
- Subject: Re: File's owner, outlets and methods
- From: Michael de Haan <email@hidden>
- Date: Thu, 13 Aug 2009 14:24:09 -0700
On Aug 13, 2009, at 1:59 PM, Dave Carrigan wrote:
On Aug 13, 2009, at 1:32 PM, Michael de Haan wrote:
The inspector of File's owner in the "Custom" xib shows, as
expected an outlet ( which is connected) as well as the method
"showPanel" which is *not* connected. In fact, I am unable to
"connect" ( if that is the correct terminology) the "About
NewApplication" to this, or to the File's owner (control-drag), but
am able to do so to the AppController object in the mainMenu.xib
I'm not 100% sure, but it seems like you're saying that you are
trying to connect the About NewApplication menu item in MainMenu.xib
to the Files Owner in Custom.xib?
Can I withdraw my post? :-(
You just made me realize something that I had missed completely....and
I won't say what it is, it's too embarrassing!
If that is the case, you can't do that. All connections must be
between objects and proxy objects within a single xib. The nib
loading process only works on a single nib at a time and doesn't
know anything about what might be in some other nib.
[
**Very** briefly, the set up is as follows.
AppController has an outlet (IBOutlet NSPanel *aboutWindow) and a
method (-(IBAction) showPanel: (id) sender;)
]
So, there are really 2 things happening here?
One is that the About Window's target is established in the
MainMenu.xib ( ie About NewApplication is connected to the method
showPanel).
Secondly, in the About.xib the File's owner is set to the
AppController AND File's owner "aboutWindow" outlet is now pointed to
the NSPanel object.
I am assuming that this second action is used in the method of
showPanel, where I assume? AppController's outlet is utilized?
-(IBAction) showPanel: (id) sender
{
BOOL successful = [NSBundle loadNibNamed: @"About" owner: self];
}
Dave...thanks for that insight so far.
_______________________________________________
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