Search code examples
macosnstableviewnsoutlineview

Subclass NSTableRowView for NSOutlineView


If you have a tableView and want to use a subclass of NSTableRowView, you can use the delegate function - (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row. Any ideas of how I can do this with an NSOutlineView (without subclassing NSOutlineView)?


Solution

  • The NSOutlineView has this delegate method:

    • (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item

    that serves the same purpose for an outline view. I don't see this method in my docs in Xcode, but it's declared in NSOutlineView.h in MacOSX10.7.sdk