Re: Controller Binding
Re: Controller Binding
- Subject: Re: Controller Binding
- From: email@hidden
- Date: Sun, 23 Nov 2003 14:41:44 -0500
For reasons of design, I've opted for subclassing NSValueTransformer,
but it does not seem to work:
- (id) transformedValue: (id)value
{
if (value == NSNoSelectionMarker)
return @"dgsdgdsg";
else
return @"dsgdgfgsdg";
}
Apparently, value is the same proxy object each time, so I can't test
it. How do I implement this function?
On 23 Nov 2003, at 1:15 PM, Shaun Wexler wrote:
>
On Nov 23, 2003, at 9:31 AM, email@hidden wrote:
>
>
> I have an NSArrayController Object that is the data source for an
>
> NSTableView. I want a button to have one title if a row in the
>
> NSTableView is selected and other title if nothing is selected. How
>
> can I achieve this with the controller layer?
>
>
Create a subclass of NSValueTransformer. Bind the button's title to
>
the controller's selection, and use the transformer. Set the true and
>
false strings when you create the transformer instance, and register
>
it by name (which you will then type directly into IB).
>
--
>
Shaun Wexler
>
MacFOH
>
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.