macosswift3nstableviewcocoa-bindingsnstableviewcell

should i used view-based cell or bindings to populate tableview


I am new in Mac Development. I am bit confused that either I should use View-based cells and implement the tableview delegates to populate or I should use bindings. My other question is that would i use the buttons and check-boxes in tableview cell when I use binding in tableview. Any help would be appreciated.


Solution

  • In general, you should use a NSView-based table view.

    Start with a datasource and delegate if you're not familiar with NSTableView or bindings. When you use a datasource it's easier to see what you're doing. Bindings work if you do it right. If you do something wrong, bindings don't work and are difficult to debug. When you're familiar with datasource and bindings, it is possible to combine them.

    You can use buttons and checkboxes in a table view. All controls are supported by a datasource and by bindings.

    Documentation: Table View Programming Guide for Mac

    Sample code: TableViewPlayground

    I don't know who invented the nstableviewcell tag but class NSTableViewCell doesn't exist.