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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to