Is automatic key-value validation possible?
Is automatic key-value validation possible?
- Subject: Is automatic key-value validation possible?
- From: Christian Gottschall <email@hidden>
- Date: Sat, 18 Sep 2004 17:55:38 +0200
Hi,
when I implement a validation method for some property Hugo, is there a
way to bind e.g. a NSTextField to that property such that Cocoa itself
takes care of validation (by automatically calling validateHug:error:,
just like it calls setHugo: for actually setting the value)?
At the current stage of my knowledge, there are only programmatic ways
to achieve input validation: (1) I could implement an appropriate
NSFormatter for each NSTextField; or (2) I could do validation in the
delegate's control:textShouldEndEditing: method. Of course both are
possible and fairly easy, but it would seem even more convenient if the
NSTextField itself would call the appropriate validation method. If
validation fails, it could refuse accepting the input. Can I achieve
this with Cocoa bindings alone?
Best regards,
Christian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden