Mac Cocoa App - Objective-C - Different Main menu in different NSViewController

275 views Asked by At

I have a Main menu set in my Application. It has App, Edit, View and Window menus. That is what I need in the main NSViewController.

However there is another NSViewController which the user can open, and I would like to add some menu items to Edit menu, while this NSViewController is active.

What is the standard was of achieving this?

1

There are 1 answers

0
Yogesh Arora On

You can use the NSMenuDelegate method such as

- (void)menuNeedsUpdate:(NSMenu*)menu;

And inside this method you can Add/Remove or Enable/Disable the specific item based on specific conditions.