【发布时间】:2020-09-25 16:02:20
【问题描述】:
我需要添加一个带有复选框的自定义单元格,即 NSButton 和 NSImageCell。
我搜索并发现我需要重写 NSBrowserCell 来实现这一点,但委托方法不会像在 NSTableView 中那样返回任何 NSView 或 NSCell。
委托方法如下所示:
- (void)browser:(NSBrowser *)sender
willDisplayCell:(NSImageCell *)cell
atRow:(NSInteger)row
column:(NSInteger)column{
NSBrowserCell *bcell = [[NSBrowserCell alloc] initImageCell:nil];
// cell = bcell;
}
很明显不能返回单元格,那如何更新单元格呢?
【问题讨论】:
-
要替换所有单元格吗?
-
@Willeke:是的,我想全部替换
标签: objective-c macos cocoa nsbrowser