Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何绑定 NSOutlineView(或 NSTableView)以使项目可以编辑?我知道它有可编辑的字段,但我不确定如何使用它,所以任何帮助都会很好。我有一个绑定到 NSArray 的 NSTreeController。谢谢。
Editable 不是 NSTableView 或 NSOutlineView 的属性,而是 NSTableColumn 的属性。如果您查看 Cocoa Bindings Reference,您会发现 NSTableColumn 还公开了一个 NSEditableBinding(好吧,它没有这么说,但确实如此——这是 Apple 文档的特质之一)。当您以编程方式(绑定:) 或在 IB 中设置绑定时,将 NSConditionallySetsEditableBindingOption 添加或检查到选项中,一切就绪。