• 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: Sorted Table Column
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorted Table Column


  • Subject: Re: Sorted Table Column
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 15 Dec 2009 13:26:14 -0500
  • Organization: Rogue Research Inc.

On 12/14/09 10:09 PM, Graham Cox said:

>>> I have an NSTableView with just one column, filled by some
>NSArrayController.
>>>
>>> Initially the items are not in any recognizable order.
>>> When I click on the NSTableHeaderView a triangle appears and now the
>items are nicely sorted.
>>>
>>> Is it possible (either in InterfaceBuilder or programmatically) to
>make the NSTableColumn start with this sorted behaviour?
>>
>>
>> In your -awakeFromNib method, pass the sortDescriptors from the table
>view to the array controller.
>
>I think I got that wrong

Actually, that's what I do, and it works well.  You can set up sort
properties in IB on a tablecolumn but not on an array controller.  On
the tablecolumn, I'll set the 'sort key' attribute and the 'selector'
attribute (to localizedStandardCompare:, if you support 10.6+) then in
my windowcontroller's awakeFromNib I set the arraycontroller's sort
descriptor by fetching the tableview's.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: 
 >Sorted Table Column (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Sorted Table Column (From: Graham Cox <email@hidden>)
 >Re: Sorted Table Column (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSPredicate like NSLiteralSearch
  • Next by Date: Re: Wierd Crash Report
  • Previous by thread: Re: Sorted Table Column
  • Next by thread: Practicality of memory debugging idea?
  • Index(es):
    • Date
    • Thread