Re: NSValueTransformer problem with NSTextField update
Re: NSValueTransformer problem with NSTextField update
- Subject: Re: NSValueTransformer problem with NSTextField update
- From: Paul Bruneau <email@hidden>
- Date: Thu, 1 Oct 2009 10:11:52 -0400
On Oct 1, 2009, at 9:47 AM, Graham Cox wrote:
I don't have a definitive answer for you, but I've observed similar
behaviour in some of my text fields. As long as you're typing, what
you type is what the field will display. On enter/return, the value
is sent to the data model, through the transformer if necessary. The
question is what happens then?
exactly!
For fields that are updated via KVO, I find that the reverse
transformation will be applied and the field gets updated. That
makes sense because there is a notification coming back from the
data model that updates the UI. For fields where I just have a one-
way type of situation (plain target-action, say), the field doesn't
get updated - again for obvious reasons.
Everything you say here makes sense. This would apply to bindings
also, wouldn't it?
So I'd be looking at the data model --> view data path for the
solution to this, not the other way around.
Not sure if this is any help, but you don't state how your UI and
data model connect - target/action, KVO or bindings.
Thank you, Graham-
Sorry, I should have stated my connection mechanism. I am using
bindings.
Initially, I was using KVO in the table, and I thought maybe that
difference had something to do with it, but since that time, I have
converted everything in the table to bindings, removed all the glue
code, and I still see the same behavior (I have an NSPopUpButtonCell
in one of the columns, and in the beginning I had that wired up with
KVO, but I later learned how I could use it with bindings, hence the
change).
Additionally, I just tested on a new NSTableView with nothing but
bindings, and it shows the same behavior as the original table view
(the NSTextFieldCell gets updated)
And finally, I just tried binding to the NSTextFieldCell of an
NSTextField and I saw the same behavior as binding to the field itself
(I was testing if there was something about NSTextFieldCell that made
the bindings do the update, but it seems that's not it).
At this point, I would settle for an ugly workaround to make my text
fields do the same update as my table views' cells. Does anyone know a
way?
_______________________________________________
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