Is it possible to design NSCell subclasses in Interface Builder?

后端 未结 10 1263
终归单人心
终归单人心 2020-12-13 15:09

I\'m trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder

10条回答
  •  不思量自难忘°
    2020-12-13 15:27

    I found some interesting examples which I do not totally understand, though.

    • GitX extends the NSTextFieldCell in their PBIconAndTextCell, referencing this post.
    • WWDC 2009 - Session 110 "Presenting User Data with Table Views and Browsers" talks "Adding subviews" and "Custom cell editors". (I do not have the source code, though.)
    • Display an NSTextfieldCell containing text and an image within a NSTableView, #70
    • Display an NSTextfieldCell containing text and an image within a NSTableView, #71

    The last 2 examples work with NSTableViewDataSource and NSTableViewDelegate. I would like to use Bindings an ArrayController in the InterfaceBuilder to connect other UI elements like text fields.

    • I stumbled into another discussion where Abizern points out PXListView by Alex Rozanski which looks very promising!

    • I am trying to implement a solution for the problem myself. Please find my project on github and the latest rendering problems over here.

提交回复
热议问题