• 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: Enable NSTableView ordering.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable NSTableView ordering.


  • Subject: Re: Enable NSTableView ordering.
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Fri, 19 Dec 2003 07:22:45 -0800

Hello...

The order of the items that are displayed in an NSTableView is determined by your datasource object. So, you need to provide the items for the correct row/columns in the order you want when the tableview calls the tableView:objectValueForTableColumn:row: method in your datasource object.

If you want to be able to sort your data when a particular column header is clicked on, one way to do it would be to assign your datasource as the delegate of the tableView and implement the delegate method

- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn;

When this method is called, then you should sort your data for the provided column. At the end of this method you would need to call [tableView reloadData] so that the tableView will know that it needs to refresh all of the displayed rows/columns with the new data you just sorted.

Hope that helps,

Louis

How can I set NSTableView columns to order list?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Enable NSTableView ordering. (From: Roberto <email@hidden>)

  • Prev by Date: fonts - yet another desperate plea
  • Next by Date: SFAuthorizationView? Supporting 10.2 and 10.3
  • Previous by thread: Re: Enable NSTableView ordering.
  • Next by thread: NSWorkspace and removable medias...
  • Index(es):
    • Date
    • Thread