Re: NSTabView Bindings
Re: NSTabView Bindings
- Subject: Re: NSTabView Bindings
- From: Quincey Morris <email@hidden>
- Date: Tue, 22 Dec 2009 04:11:15 -0800
On Dec 21, 2009, at 22:02, Gerriet M. Denkmann wrote:
>
> I am trying to bind "editable" of an NSTableColumn to ObjectController tabView.selectedIndex
> (The tab view has two items: Read and Edit. When the first item is selected, my table column should not be editable).
>
> But I am told:
> [<NSTabView 0x10027d010> valueForUndefinedKey:]: this class is not key value coding-compliant for the key selectedIndex.
>
> On the other hand, the Cocoa Bindings Reference for NSTabView says: "selectedIndex
> An integer value that specifies the index of the selected item in the NSTabView. When the selection changes in the NSTabView, this value is updated with the index of the newly selected item."
>
> So: what is going on?
> And: how do I make my table column editable if and only if the first tab view item is selected?
"selectedIndex" is a binding, not a property. There is no NSTabView property that makes the selected tab index available directly.
The simplest way to do this is probably to create an "isFirstTabSelected" property in your window controller (tracking changes to the tab view state), and bind the table column's "editable" binding to that property.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden