Is there a good example of a
full-featured outline view anywhere?
The rest of my UI is bindings based, so I'm having to foray into Data Sources and Delegates for my outline view and there are quite a few details to get right.
I inadvertently rolled by own node object before discovering CPNode, which seems better, so I'll reimplement with that.
Maybe because of that, I've noticed that if I implement:
- (BOOL CPOutlineViewDelegate)outlineView shouldSelectItem:
...to avoid selection on non-leaf nodes, I get an error:
[Error] CPInternalInconsistencyException: Data source must implement 'outlineView:child:ofItem:'
That's odd because this method is absolutely implemented on the DataSource/Delegate object and indeed if I don't try to implement this method then the outlineView is populating fine with data. However, it may be that because I rolled my own node, there's no -isLeaf etc. implemented on the node object.
I will need to be able to make sense of selection row Id to model object mapping, because that depends on what group levels are open and taking up non-leaf rows in the table.
I will also need to figure out how to get filtering working again from a CPPredicateField.
I'm replacing a CPTableView with this outline view and previously all that was handling with binding to an array controller, but my outline view Data Source just comes off my underlying data array (which would have been the array bound into the array controller), so things look a bit more complicated.
This all seems like a lot more work, but I'm sure most of it is quite boilerplate... hence the interest in a good full-featured example!