Bindings: Why Doesn't Key Value validation Update The UI?
Bindings: Why Doesn't Key Value validation Update The UI?
- Subject: Bindings: Why Doesn't Key Value validation Update The UI?
- From: Keary Suska <email@hidden>
- Date: Mon, 16 Feb 2009 15:49:36 -0700
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 (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