• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programmatically click a column header in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Programmatically click a column header in NSTableView (From: "Joe Goh" <email@hidden>)

  • Prev by Date: Re: My Core Data experiences
  • Next by Date: Re: Setting the application Icon
  • Previous by thread: Re: Programmatically click a column header in NSTableView
  • Next by thread: NSBrowser and NSLineBreakByTruncatingMiddle
  • Index(es):
    • Date
    • Thread