# Sorting an NSOutlineView?



## waehlby (Aug 21, 2002)

Does anyone know how I capture a didClickTableColumn message from an NSOutlineView. I want to sort the NSOutlineView based on the column clicked just like in the Finder listview.

I read the post at cocoadev: http://www.cocoadev.com/index.pl?SortingTableViewByColumn but it seems as if this delegate function only applies to NSTableView and not NSOutlineView.

Any ideas?

/anders


----------



## iconara (Aug 21, 2002)

NSOutlineView is a subclass of NSTextView, so it will probably work just fine.

theo


----------



## waehlby (Aug 21, 2002)

That's what I thought, but it doesn't work for me. Maybe I'm missing something.

For NSTableView the declaration is:

<code>- (void) tableView: (NSTableView *) tableView didClickTableColumn: (NSTableColumn *) tableColumn</code>

Would it be the same or would it be:
<code>- (void) outlineView: (NSOutlineView *) outlineView didClickTableColumn: (NSTableColumn *) tableColumn</code>


----------



## iconara (Aug 21, 2002)

it would be the same (the first line). if that doesn't work, I suggest looking at the documentation for NSOutlineView, at the bottom, there all the notifications and delegate methods should be listed.


theo


----------

