Solved it!
Turned out I had to implement the following method in the NSOutlineView
delegate
- (NSView *)outlineView:(NSOutlineView *)outlineView
viewForTableColumn:(NSTableColumn *)tableColumn
item:(id)item {
if ([self outlineView:outlineView isGroupItem:item]) {
NSString *vId = [[[outlineView tableColumns] objectAtIndex:0] identifier];
return [outlineView makeViewWithIdentifier:vId owner:self];
}
return [outlineView makeViewWithIdentifier:[tableColumn identifier] owner:self];
}
Apparently, by default view based NSOutlineView generate view for each cell in the table by locating the view with the same identifier as the column. In the case of a group item / group row however, there is no tableColumm
associated with that row, therefore the view turns out to be nil and not show up.
Playing around with apple's TableViewPlayground sample project really helped! Highly recommended!
Addendum: In Interface Builder if you add Source List object instead of Outline View, it will add two prototype view rows for you.
Allowing you to design different looking header and data rows and referring to them in code by their identifier.
Header Cell:
Data Cell:

You can of course also manually add as many prototype view rows as you like.