NSOutlineView Delegate 和 OutlineCell 中的错误?
由于某种原因,除非某个项目是组项目(outlineView:isGroupItem
返回 YES
),否则
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayOutlineCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
永远不会在指定的 NSOutlineView
委托中调用该方法,即使该项目可展开并且该项目的 outlineView:shouldShowOutlineCellForItem:
返回 YES
。这对我来说似乎是一个错误。知道这是否是预期的行为吗?如果是这样,我该如何解决它以更改披露三角形?
环境:
Xcode 4.2
OS X Lion 10.7.2
For some reason, unless an item is a group item (outlineView:isGroupItem
returns YES
), the
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayOutlineCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
method is never called in the designated NSOutlineView
delegate, even when the item is expandable and outlineView:shouldShowOutlineCellForItem:
for the item returns YES
. This seems like a bug to me. Any idea if this is the intended behavior? If so, how can I work around it to change the disclosure triangle?
Environment:
Xcode 4.2
OS X Lion 10.7.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我来说效果很好。您应该将代码分解为最简单的示例,您可能会在数据源或委托中看到一些其他代码的意外结果。
This works fine for me. You should break your code down to the simplest possible example, you're probably seeing an unintended consequence of some other code in your datasource or delegate.