gpt4 book ai didi

objective-c - 电子表格网格的 NSCell vs NSView?

转载 作者:行者123 更新时间:2023-11-28 05:32:36 26 4
gpt4 key购买 nike

我正在尝试为 mac osx 创建一个功能齐全的电子表格网格控件。看来 NSTableViewNSCollectionView 都不合适,所以我正在研究自定义控件。从我的研究到现在看来,两种主要方法似乎是让网格中的单元格派生自:

  1. NSCell
  2. NSView

哪个更适合我的目的,为什么?

最佳答案

NSCell 已(非正式地)弃用,因此我不会基于它制作任何新内容。使用 NSView。

来自 10.10 的 AppKit 发行说明:

Gradual deprecation of NSCell

Mac OS X 10.10 takes another step towards the eventual deprecation of cells. Direct access to the cell of a control is discouraged, and methods which allow it will be formally deprecated in a subsequent release. A variety of cell-level APIs have been promoted to various Control subclasses in order to provide cell-free access to important functionality. NSLevelIndicator, NSTextField, NSSearchField, NSSlider, and NSPathControl all have new properties for this purpose. Cell-based NSTableViews are now deprecated, and view-based NSTableViews should be used instead. Matrix-based NSBrowsers are also deprecated in favor of the item-based interface.

关于objective-c - 电子表格网格的 NSCell vs NSView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27144024/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com