On Jan 18, 2014, at 19:45 , Roland King <r...@rols.org> wrote:

> So perhaps the question is .. what property do I need to set on the 
> NSTextField to get it to go back the other way? I've tried [ textField 
> setValue:.. ] but that just throws an exception that setValue: isn't 
> implemented on NSTextField, which it isn't, so I went back to setStringValue: 
> But setting stringValue: changes the on-screen string, but doesn't trigger 
> the binding to send the string back the other way. 

I think you need to setObjectValue, not setStringValue. “objectValue” is the 
underlying property that all controls have, from which “intValue”, 
“stringValue” etc are derived, so presumably the text field “value” binding is 
bound to “objectValue”.

Alternatively, don’t use ‘set<anything>’ on the text field at all, but let the 
Browse button action method update the *data model*, and then let the binding 
change the text field. This may seem weird, because the button action method 
would have to apply the reverse transformer itself, but it’s actually cleaner, 
because it doesn’t make the button behavior depend on the text field.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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

This email sent to arch...@mail-archive.com

Reply via email to