Re: Using multiple bindings to enable a button
Re: Using multiple bindings to enable a button
- Subject: Re: Using multiple bindings to enable a button
- From: Steve Mills <email@hidden>
- Date: Tue, 10 Feb 2015 23:45:07 -0600
On Feb 10, 2015, at 23:04:02, Quincey Morris <email@hidden> wrote:
>
> Are you sure that the “comboStringValue” property is KVO-compliant? Is it a NSString or a NSMutableString?
I'm not sure about the KVO compliancy. I'm still a newbie in this area. Let me give you the rundown on the stuff that deals with it.
@interface WindController : NSWindowController
@property (weak) NSString* comboStringValue;
@end
The window has:
A Combobox binds its Value to File's Owner.self.comboStringValue, because I've learned you can't bind directly to a field's stringValue.
A button binds its Enabled to File's Owner.self.comboStringValue.length.
Another button binds its Enabled to Keywords Array Controller.selection.@count and its Enabled2 to File's Owner.comboStringValue.length.
The 2nd button is the one that doesn't behave when the bindings are in that order. Swapping them fixes it. I've tried swapping them back to the original orientation multiple times, and it always fails to work properly when they're in that order.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
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