简体   繁体   中英

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

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

NSCell is a lighter weight object and was a solution when it was a concern to have too many NSView objects. Think more than a decade ago. Cells are deprecated. Use views.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM