NSComboBox with multiple selection Cocoa

1.4k views Asked by At

Multiselect NSComboBox

Can we have a NSComboBox with multiple selection through checkboxes in OSx. Please find the attached image as an example.

Please help.

1

There are 1 answers

2
Aviram Netanel On

According to the NSComboBox class reference - the answer is NO.

as you can see on the Manipulating the Selection:

@property(readonly) NSInteger indexOfSelectedItem
@property(readonly, strong) id objectValueOfSelectedItem

- deselectItemAtIndex: 
- selectItemAtIndex:
- selectItemWithObjectValue:

they refer to the selected item as single selection.

so I'd suggest looking for a custom solution, like keeping the selections on a different array and binding it together.