Re: binding to number of selected rows in a table
Re: binding to number of selected rows in a table
- Subject: Re: binding to number of selected rows in a table
- From: Corbin Dunn <email@hidden>
- Date: Wed, 04 Mar 2009 08:21:32 -0800
On Mar 3, 2009, at 6:38 PM, James Walker wrote:
I want to use bindings to set certain control attributes (enabled
state, tool tip) depending on the number of selected rows in an
outline table. I have a controller object that owns an
NSOutlineView, and I gave it an accessor
- (NSOutlineView*) outlineView;
Then I tried to bind to my controller with key paths like
outlineView.numberOfSelectedRows and outlineView.selectedRowIndexes,
and using value transformers. It looks like the bindings are
setting the attributes appropriately once, but then not updating
when the selection changes. Are these NSOutlineView methods not KVO-
friendly, or am I doing something wrong?
It sounds like you are trying to do something like [foo bind:@".."
toObject:controller withKeyPath:@"outlineView.selectedRowIndexes"..].
This is trying to watch for changes on the selected rows. Cocoa does
not support binding to view properties like this. Most are not KVC
compliant.
corbin
_______________________________________________
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