Dombi Bence
Dombi Bence

Reputation: 788

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

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?

Upvotes: 0

Views: 275

Answers (1)

Yogesh Arora
Yogesh Arora

Reputation: 19

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.

Upvotes: 1

Related Questions