I have an NSTableView
of which one column contains NSPopUpButtonCell
s. This column is assigned to an IBOutlet
. My application's controller class creates a menu in it's init
and assigns it to the NSTableColumn
's dataCell, which is the NSPopUpButtonCell
.
The menu looks as follows:
NSPopUpButton
NSMenu
NSMenuItem item1
NSMenuItem item2
NSMenuItem item3
NSMenu
NSMenuItem item3_1
NSMenuItem item3_2
NSMenuItem item4
NSMenuItem item4_1
NSMenuItem item4_2
NSMenuItem item4_3
When I click the menu and choose item1 or item2, my data source's tableView:setObjectValue:forTableColumn:row:
is fired and the objectValue is 0 or 1, the index of the chosen item.
However, when I pick an item from one of the submenus, the objectValue I get is -1. How would I be able to get the menu item which was chosen?