Search code examples
macoscocoanstableviewappkit

View and Cell based NSTableView


What is the main difference between cell based and view based tableviews in Cocoa.

The understanding I have is cell based tableviews are basically used for displaying strings and view based are for custom cells.User events such as dragging rows, selection etc can be handled in view based.

cell based tableviews use objectValueForTableColumn: method and view based tables use viewForTableColumn: method.

Is my understanding correct?. Or is any other design concerns between these table views. When to go for cell based and when to go for view based.

Thanks in advance


Solution

  • short answer:

    A cell can contain only one UI element like a text cell, image view cell, button cell and a few more. The customization ability is quite poor.

    A view can contain multiple UI elements as well as other views. The customization ability is almost infinite.

    Apple recommends to use always view based table views