Re: Programmatically click a column header in NSTableView
Re: Programmatically click a column header in NSTableView
- Subject: Re: Programmatically click a column header in NSTableView
- From: Tristan Jehan <email@hidden>
- Date: Wed, 24 Jan 2007 14:14:20 -0500
Thanks Joe! It appears to be a good solution. Exactly what I wanted
to do. Cheers,
Tristan
On Jan 24, 2007, at 6:06 AM, Joe Goh wrote:
On 1/23/07,Tristan Jehan <email@hidden> wrote:
I've been trying to programmatically click an NSTableHeaderCell to
force the NSTableView to resort the data, and change its current
highlighted header to the new one. The following has no effect and I
don't understand why... Could someone help? Thank you.
What worked for me is to set the sort descriptor for the NSTableView,
something like this:
NSSortDescriptor* sortDescriptor = [[[NSSortDescriptor alloc]
initWithKey: @"some_sort_key" ascending: YES] autorelease];
[someTableView setSortDescriptors:[NSArray
arrayWithObject:sortDescriptor]];
Hope this helps!
Joe Goh
FunkeeMonk Technology
http://www.funkeemonk.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden