I can't imagine why I haven't come across this before but it appears that when a key-value validation method alters the passed object and returns YES, the view is not updated with the coerced value.

I need behavior, for instance, where an NSTextField is supposed to display a numerical value that if the field is cleared that it is re- set to 0. Sounds simple, but I can't get it to work. Calling a KVC setter in validateKey (which could be bad) doesn't cause the update. Neither doing the same in the setter (also sounds like a bad idea anyway).

It seems like I have two options: set a transformer (that is really acting like a validator) or trick bindings with a change-value-for-key notice triggered using performSelector:afterDelay:.

Anyone have any better ideas?

TIA,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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

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

Reply via email to