Re: Get specified window from nib
Re: Get specified window from nib
- Subject: Re: Get specified window from nib
- From: Andy Lee <email@hidden>
- Date: Tue, 12 Aug 2008 06:33:09 -0400
On Aug 10, 2008, at 10:07 PM, Graham Perks wrote:
On Aug 10, 2008, at 9:01 PM, Fosse wrote:
I have one nib containing more than ten dialogs and want to get the
specified window after nib is loading..
Perhaps NSNib's instantiateNibWithOwner:(id)owner topLevelObjects:
(NSArray **)topLevelObjects ? You'll get an array of top level
objects, which will presumably contain your dialogs... If it were me
I'd just join them up in IB. You only need to do it once.
Graham.
What did you think of Graham Perks's suggestion to use NSNib to load
the nib file?
I haven't used NSNib myself -- only glanced at the docs -- but I
believe it's the only way to get your program to know about the names
you assigned your windows in IB. So if you rely on those names to
pick the one you want, you're going to be stuck retyping them
somewhere anyway, whether to make them into outlets or some other place.
If there's some other attribute of the window you can use to select
them, like a unique window title, one possibility is to scan the
window list. See the NSWindowList() function. This assumes you only
load the nib once and the window names are unique application-wide and
they never change.
--Andy
_______________________________________________
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