开发者

Horizontal NSTableView (i.e. entity data per column vs. standard entity data per row)

I am trying to create a Mac OS X Cocoa based application with data displayed in a tabular format, but the data needs be displayed vertically in one column per entity instead of the standard NSTableView one row per entity functionality.

Is there an appropriate Cocoa class for this? Essentially I'm looking for a "horizontal" table of NSControls, but I do not need headers, sorting, etc. I just need a view to bind my core data array of entities to that displays the data in various NSCells depending on the field. (i.e. instead of one column of checkboxes and another column of textfields, I need one row of checkboxes and another row开发者_如何学C of textfields, etc.)

Thanks!


There is no pre-baked Cocoa control that handles this exactly like a table, just in "vertical" mode.

You might try NSCollectionView set to one row and unlimited columns. Create your NSCollectionViewItem (as the "prototype" or template) in a vertical configuration and you should be good to go for the most basic needs and even throws in some pretty animation.

The problem is, it's only available starting at 10.5 and is a lot less useful unless you're targeting 10.6 as a minimum. Even then NSCollectionView/Item can quickly become too unwieldy if your needs go beyond the basics it provides. At that point, creating your own home-brewed equivalent that targets what you need might be easier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜