So I have a perfect working NSTableView for a Mac App. I added a new column on it, and I am trying to set it as Combo, but I am facing a lot of issues. First is, if I drag and drop the NSComboBoxCell on the Storyboard, it will lose all my other columns (weird thing #1). So I decided to overwrite my NSTextFieldCell, which looks like is the way to go. But now the items on my combobox are not showing up.
- (NSView*)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *cell = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
if ([tableColumn.identifier isEqualToString:@"typeCell"]) {
NSComboBoxCell *combo =(NSComboBoxCell*) [cell.textField viewWithTag:10];
[combo addItemsWithObjectValues:@[@"Test"]];
}
Any idea on what I am doing wrong? The column is also already editable.