• 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: NSTableView sort with a data source (silly question ?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView sort with a data source (silly question ?)


  • Subject: Re: NSTableView sort with a data source (silly question ?)
  • From: vincent habchi <email@hidden>
  • Date: Mon, 3 May 2010 17:14:02 +0200

Le 3 mai 2010 à 17:08, Graham Cox a écrit :

>> 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.

Ok, that's what I was prepared to do.

> 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.

Well, ideally yes. In my case, it involves adding the selector to respond to the click, and append an auxiliary clause to a SQL request (SORT BY xxx ASC/DESC) and reload data. It's not two lines, but I agree it is not much work either.

Thanks for confirming my opinion!
Vincent_______________________________________________

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: 
 >NSTableView sort with a data source (silly question ?) (From: vincent habchi <email@hidden>)
 >Re: NSTableView sort with a data source (silly question ?) (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSTableView sort with a data source (silly question ?)
  • Next by Date: Re: Compress / Uncompress
  • Previous by thread: Re: NSTableView sort with a data source (silly question ?)
  • Next by thread: Help! (Help Book does not register)
  • Index(es):
    • Date
    • Thread