【发布时间】:2015-11-12 23:55:51
【问题描述】:
outlineViewItem 展开时 -
(void) outlineViewItemDidExpand:(NSNotification *)notification
-,我能够成功地将对象添加到 TreeController(日志语句将新添加的对象显示在层次结构的正确位置),但 OutlineView/UI 没有更新以反映该插入。
没用,我用过
[self.outlineView reloadItem:nil reloadChildren:YES],[self.outlineView reloadData],甚至是[self.outlineView setHidden:YES]然后[self.outlineView setHidden:NO]
尝试强制重新加载结构。
这一切都是在 Objective-C 中以编程方式完成的。
【问题讨论】:
-
你使用绑定还是只使用
NSOutlineViewDataSource-protocol 方法? -
我对值、大纲视图内容和索引路径 (NSOutlineView) 以及内容数组/控制器内容 (NSTreeView) 使用绑定。我使用的唯一代表是: - (void) outlineViewItemDidExpand:(NSNotification *)notification
标签: objective-c macos cocoa nsoutlineview nstreecontroller