Can't CTRL+Drag NSButton to custom NSView header

前端 未结 1 1944
情歌与酒
情歌与酒 2021-01-21 13:18

I\'d like to create a custom NSTableCellView instantiated by Interface Builder. I\'ve set my Table Cell View class to MyTableCellView, and properly cre

1条回答
  •  攒了一身酷
    2021-01-21 13:42

    I finally found a solution, that is a little weird but works as expected. Instead of connecting the NSButton to MyTableCellView header directly, I used the reversed path:

    Manually create an outlet:

    @property(retain, nonatomic) IBOutlet NSButton* button;
    

    Then click the empty circle on the left, and drag it to your XIB file's button:

    enter image description here

    I have no idea why it works this way, please let me know if you know the anwser.

    0 讨论(0)
提交回复
热议问题