我有一个基于NSOutlineView的视图,在一列中有我的自定义NSTableCellView(包含NSImageView和NSTextField)
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(CustomItem*)item
{
CustomTableCellView *cellView [outlineView makeViewWithIdentifier:tableColumn.identifier owner:self];
cellView.textField.stringValue = item.name;
return cellView;
}
答案 0 :(得分:0)
我自己找到了解决方案,我可以使用NSOutelineViewDataSource方法来监控排序描述符的变化。
- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray<NSSortDescriptor *> *)oldDescriptors
{
}