开发者

Editable OutlineView with Cocoa Bindings

开发者 https://www.devze.com 2023-02-10 03:56 出处:网络
How do you bind the NSOutlineView (or NSTableView) so that the items can be editable?I know that there\'s the editable field for it but I\'m not sure how to use it so any help for开发者_开发问答 it wo

How do you bind the NSOutlineView (or NSTableView) so that the items can be editable? I know that there's the editable field for it but I'm not sure how to use it so any help for开发者_开发问答 it would be nice. I have a NSTreeController that's bind to a NSArray. Thanks.


Editable is not a property of NSTableView or NSOutlineView but of NSTableColumn. And if you check Cocoa Bindings Reference, you'll find that NSTableColumn also exposes an NSEditableBinding (well, it doesn't say so, but it does -- one of the idiosyncrasies of Apple's documentation). When you set the binding, either programmatically (bind:) or in IB, add or check NSConditionallySetsEditableBindingOption to the options, and you're all set.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号