Re: programmaticaly modify .nib files
Re: programmaticaly modify .nib files
- Subject: Re: programmaticaly modify .nib files
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 6 May 2005 08:47:11 -0600
On May 6, 2005, at 7:28 AM, Frank D. Engel, Jr. wrote:
I think I figured out how to load the NIB file (using the NSNib and
NSBundle classes),
All you need to do is use the +[NSBundle loadNibNamed:owner:] method.
but how do I actually get a reference for a specific dialog within
the NIB file? There are four different versions of the dialog, and
I want to display a different one depending on the parameters sent
to the method.
You need to set the owner in the nib file by choosing the "File's
owner" object and setting a custom class in the info window. If the
nib contains a window, then you should consider subclassing
NSWindowController and setting the owner to the subclass.
NSWindowController has built-in nib loading methods.
But what are you putting into the dialog? If it's just a simple
message and OK/Cancel/Don't Save/etc. window, then you should instead
consider using the NSAlert class.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden