On 01/10/2009, at 10:49 PM, Paul Bruneau wrote:

But when I use the transformer on a regular NSTextField, I don't get that benefit. It properly transforms the value and the correct value gets stored in my model, but the reverse transformation doesn't fire like it does when used in the table view.


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?

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.

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.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to