• 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: Graham Cox <email@hidden>
  • Date: Mon, 14 Dec 2009 22:09:34 +1100

On 14/12/2009, at 10:00 PM, Graham Cox wrote:

>
> On 14/12/2009, at 9:56 PM, Gerriet M. Denkmann wrote:
>
>> 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 - this is what I do (for example) in most of my table views to establish an initial sorting. With NSArrayController, I'm not sure if you need to explicitly pass the sortDescriptors also to that or whether it gets them anyway through bindings.

	NSTableColumn* col = [mMetaTableView tableColumnWithIdentifier:@"key"];
	[mMetaTableView setSortDescriptors:[NSArray arrayWithObject:[col sortDescriptorPrototype]]];

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Sorted Table Column
      • From: "Sean McBride" <email@hidden>
    • Re: Sorted Table Column
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >Sorted Table Column (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Sorted Table Column (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Sorted Table Column
  • Next by Date: Re: App Launches in Finder, Hangs While Launching in Debugger
  • Previous by thread: Re: Sorted Table Column
  • Next by thread: Re: Sorted Table Column
  • Index(es):
    • Date
    • Thread