简体   繁体   中英

NSCell vs NSView for a spreadsheet grid?

I am trying to create a full featured spreadsheet grid control for mac osx. It appears that neither NSTableView nor NSCollectionView would be appropriate, so I am looking into a custom control. From my research to this point it appears that the two main approaches would be to let the cell in the grid be derived from:

  1. NSCell
  2. NSView

Which would be more appropriate for my purpose and why?

NSCell is (informally) deprecated, so I wouldn't make anything new based on it. Go with NSView.

From the AppKit release notes for 10.10:

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.

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