Differences between NSTableView and NSCollectionView

末鹿安然 提交于 2019-12-04 18:02:45
  1. The difference here is that in a table view, every row is one item, and the columns show different aspects (properties) of that item. In a collection view, every row-column intersection is one item.
  2. I haven't done this, but try implementing tableView:didClickTableColumn: in your table view delegate. That method is new in 10.6. You would need to get [NSApp currentEvent], and probably pass it to a method in the column's cell.
  3. With a table view, you bind the column; you don't bind the view (not to provide content, anyway; you do bind the view for things like selection indexes). With a collection view, there are no columns (see #1), so you always bind the view.
  4. No.

FWIW, NSTableView is a very old part of the AppKit, and it's a bit crufty.

If you're new to the platform, I'd recommend getting your head around NSCollectionView first.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!