How to implement different contextual-menus in a NSOutlineView

864 Views Asked by At

I have a view-based NSOutlineView and want to show different contextual menus if user right-clicks the header or one of the expanded items.

I dropped two NSMenu's to the storyboard file. When I connect the menu outlet of the HeaderCell to one of the menus I got an "Unsupported Configuration" warning and the menu is never shown. (The same warning for the Table View Cell)

I am using Swift.

Can somebody guide me to the right direction?

1

There are 1 best solutions below

0
Mari Murotani On

enter image description here

1.Add NSMenu on your scene 2.Add Outlets setting to NSOutlineView then make relationship between NSOutlineView to NSMenu 3.Add Custom Class which is overriding NSMenuDelegate