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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to