NSButton Bindings
NSButton Bindings
- Subject: NSButton Bindings
- From: Niels Meersschaert <email@hidden>
- Date: Fri, 25 Aug 2006 02:14:00 -0400
I have a table controlled with an NSArrayController. One of the
columns in that table is a path to a file. I have an NSTextField
where a user can manually enter the path. I also have a button that
provides a open/save panel to select the path thru the browser. What
I'd like to do is have the button to pop that up be bound to the
value of the text field with these rules:
If multiple values for the field are selected, the button should be
disabled.
If no selection exists, the button should be disabled.
If multiple items are selected, but the values for that field are the
same, the button should be enabled.
I've tried using the placeholders for these, with the value key being
the array controller's selection with a key path of the field. That
gives me a can't convert Bool from Object error, which makes sense.
Using a value transformer like NSNotNil, bypasses the error, but then
the placeholder selections appear to be ignored, since it enables
purely on whether the field is nil. Is my only option to create a
custom subclass of NSValueTransformer that implements the rules I
need or can I do this purely thru IB?
Thanks for your help,
Niels
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden