• 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: "Joe Goh" <email@hidden>
  • Date: Wed, 24 Jan 2007 19:06:35 +0800

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


  • Follow-Ups:
    • Re: Programmatically click a column header in NSTableView
      • From: Tristan Jehan <email@hidden>
  • Prev by Date: Strange errors in NSMovie
  • Next by Date: Floating Panel Problems
  • Previous by thread: Programmatically click a column header in NSTableView
  • Next by thread: Re: Programmatically click a column header in NSTableView
  • Index(es):
    • Date
    • Thread