Re: Rerun value transformer
Re: Rerun value transformer
- Subject: Re: Rerun value transformer
- From: Jim Correia <email@hidden>
- Date: Wed, 20 Sep 2006 11:13:32 -0400
On Sep 20, 2006, at 11:00 AM, Trygve Inda wrote:
Since you ultimately want to control the button's enabled state, you
only need a value transformer if your model object doesn't have a KVO
compliant key for its exportable state that returns a boolean.
I do not have a key that returns a BOOL as.
What logic does your value transformer use to return a BOOL then?
Value transformers can't get "re run". They aren't push/pull. The are
on-demand coercers of data.
You button should be bound, through a controller, to the isExportable
key of your model. That key should be KVO compliant. You likely
shouldn't be (or don't need to) use a value transformer at all.
The problem is that at launch time, some data is not yet loaded
when the
value transformer is called. I need the value transformer to be hit
again...
I thought that asking the button to redraw itself would invoke the
binding
tied to the value transformer.
That is not how it works. The buttons isEnabled is bound (preferably
through a controller) to a model object with a KVO compliant key.
When that key changes, the new enabled state will be reflected in the
UI.
Forget about the value transformer for the time being and so you can
take a step back and figure out what it is you want to do.
It sounds like you want the button to be enabled when your model is
in an exportable state, right?
What key path have you bound the buttons enabled to?
Jim
_______________________________________________
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