• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to load an NSMenu out of a nib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: how to load an NSMenu out of a nib?
      • From: Uli Kusterer <email@hidden>
References: 
 >how to load an NSMenu out of a nib? (From: Rua Haszard Morris <email@hidden>)
 >Re: how to load an NSMenu out of a nib? (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: how to load an NSMenu out of a nib?
  • Next by Date: Re: how to load an NSMenu out of a nib?
  • Previous by thread: Re: how to load an NSMenu out of a nib?
  • Next by thread: Re: how to load an NSMenu out of a nib?
  • Index(es):
    • Date
    • Thread