我在自定义 NSCell 中有一个 NSPopUpButtonCell 并且我正在使用
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
单击时生成弹出菜单。
我还覆盖了 copyWithZone: 在我的自定义单元格中复制 popUpCell 实例变量,以便我的表格视图中的每一行都有自己的弹出单元格。
My problem is that although the menu pops up just fine, and you can select an item from the menu, when an item is selected the cell does not change its selected item to match the chosen one from the menu.
但是,如果我用复制单元格的区域注释掉副本中的行,那么它会在选择过程中正常运行(更改以匹配所选项目,尽管每一行都将具有相同的所选项目)。
有谁知道这是为什么,或者更重要的是,我该如何解决?