I’m having trouble fully understanding all the different places you can return cells when using an OutlineView. As far as I can tell there are four places:
NSOutlineViewDataSource has:
outlineView:childoutlineView:objectValueForDataColumn
And NSOutlineViewDelegate has:
outlineView:willDisplayCelloutlineView:dataCellForTableColumn
If I have a outline view with different items, like the SourceList example, where do I do what and why? I have GroupItem headers and a tree of IconAndImage cells that subclass NSTextFieldCell. Where should these be instantiated and where should I set the styling, image and title?
What Cocoa means by the word cell is not the same as what you would call a cell in for example Excel.
In Cocoa, a cell is a
NSCellsubclass and could be considered as a light-weight reusableNSView. It is used to draw many items in the same way. E.g.So a data source does not return cells, but instead return objects that are parameters to
[(NSCell) -(void)setObjectValue:(id)value]. The delegate returns which cell-object to use for each item and should be implemented so that you only create each cell-type once. E.g.You should use table column tags or a similar feature to handle column re-ordering by the user.