Editable OutlineView with Cocoa Bindings
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.
精彩评论