Connecting A Submenu In Interface Builder

The easiest way to dynamically change menus at runtime is to link the menu in the nib to a variable in your class. This is relatively easy todo if you are connecting a non-submenu item:

  • Create an IBOutlet variable:
    IBOutlet NSMenu *clientMenu;
  • Drag the header file for the controlling class onto the nib
  • Instantiate it in instances and make the connection (make connections by holding ctrl down and dragging from one object to another).

But if you want to connect to a submenu it is harder because there is not graphical representation that you can connect it to. The solution here is to use the outline mode.

button depiction

To get into outline mode you will need to click the small button just ontop of the scroll bar on the right-hand side. You can return to icon mode by clicking the button next to it when you are done.

Outline mode shows all the resources in the NIB in a hierarchy. From this view you can locate the menus and expand them. When you find the submenu you should also find a component labeled NSMenu. All you have to do now is make the connection between that NSMenu and your outlet.

final view


Landseer (not verified)

Farming for wow gold (world of warcraft gold) isn't easy, but you can buy cheap wow gold, wow power leveling on sale. Buy wow gold here, we sell cheap world of warcraft gold. Buy wow gold age of conan goldage of conan goldage of conan goldaoc goldaoc goldaoc goldnow,I think you will have your pleasure.We have revolutionized the exchange of money to wow gold with fast delivery.Purchase world of warcraft gold online and world of warcraft gold power up your character to the next level.Welcome to our website about world of warcraft gold,delivery in 24 hours,7/24 service.

Cheap Eyeglasses (not verified)

Tiffany Jewelry Whenever glasses frame I wear my
eyeglasses, I always get acne where the plastic "... Clean
eye glasses the plastic
eyewear bridges with
Tiffany Necklaces rubbing alcohol every
Tiffany Bracelets
Tiffany Rings morning and night to kill the bacteria.
Tiffany

Post new comment

The content of this field is kept private and will not be shown publicly.