Re: how to load an NSMenu out of a nib?
Re: how to load an NSMenu out of a nib?
- Subject: Re: how to load an NSMenu out of a nib?
- From: Rua Haszard Morris <email@hidden>
- Date: Thu, 9 Apr 2009 11:55:37 +1200
Making a class with an outlet, and passing an instance of that class
as the nib's owner, is one way.
You can also use the NSNibTopLevelObjects key as described at the
bottom of http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSNib_Class/Reference/Reference.html
. You pass an NSMutableArray under this key, and after the nib is
loaded, the array is populated with the top level objects in the nib.
Thanks, I was not aware of the second option, which sounds a little
low-level but good all the same.
I have the outlet + spare class working, and it's not too weird, if I
consider my nib a collection of utility stuff, and have a utility
stuff class which loads the nib and has outlets (with accessors) for
all the things in the nib.. still, I was expecting a line or two of
code, not to have to make an instance variable for things I want out
of the nib!
I'm still shocked there's no standard way to do this...
thanks for the help
Rua HM.
_______________________________________________
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