How to add footer to NSTableView?

NSTableView doesn't seem to have the equivalent of a UITableView tableFooterView . How can I add a footer view to a table view in Cocoa?

+6
source share
1 answer

NSTableView does not have sections such as UITableView or NSCollectionView, and therefore there are no headers and footers.

Instead, you can do this through your data source if you use a table based on a view.

  • Add a cell to the table in Interface Builder with the custom style / elements you need in the footer. Give it an identifier like "TableFooter"
  • An increment (per unit) of the number of rows returned by your NSTableViewDataSource numberOfRowsInTableView(tableView:)
  • and in tableView(tableView:viewForTableColumn:row:) for this last row, create this item from the storyboard using the identifier "TableFooter".
+1
source

All Articles