NSOutlineView:为什么 shouldEditTableColumn: 被调用两次?
在我的 OutlineView 中按 Enter 一行,shouldEditTableColumn 方法被调用两次。当我点击进入时,它被调用一次。
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item{
NSLog(@"edit me");
return YES;
}
Hit enter for a row in my OutlineView, the shouldEditTableColumn method gets called twice. When I click to enter, it's called once.
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item{
NSLog(@"edit me");
return YES;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可以被调用任意多次。您不能依赖它被调用的次数。
NSOutlineView
可以选择在双击表格时调用它 50 次,而不是只调用一次。几乎任何委托方法都是如此。不管它现在如何工作,它在未来的版本中也可能很容易改变。It could be called any number of times. You can't rely on the number of times that it's called.
NSOutlineView
could choose to call it 50 times during one double click on your table instead of just once. This is true with just about any of the delegate methods. Regardless of how it works now, it could easily change in a future release as well.