Re: NSTableView sort with a data source (silly question ?)
Re: NSTableView sort with a data source (silly question ?)
- Subject: Re: NSTableView sort with a data source (silly question ?)
- From: Graham Cox <email@hidden>
- Date: Tue, 4 May 2010 01:08:58 +1000
On 04/05/2010, at 1:00 AM, vincent habchi wrote:
> Hi,
>
> this might be a silly question but, before doing any further implementation, and having found no definite answer, I dare ask it. Is there a way to sort the contents of a NSTableView whose data is provided by a data source, besides sorting at the source itself (via a suitable query)?
You provide sorted data to the table through the data source.
But the table can provide sort descriptors back to you to do this, allowing you to click table headers to pick how the data is sorted. Since the table is a view, of course it is your responsibility to provide the data in a sorted form. Responding to a change in sort descriptors and then actually performing a sort is two lines of code.
--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