• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is automatic key-value validation possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Is automatic key-value validation possible?
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Organizing an Xcode template and frameworks for plugin development kit
  • Next by Date: Re: Is automatic key-value validation possible?
  • Previous by thread: Re: Organizing an Xcode template and frameworks for plugin development kit
  • Next by thread: Re: Is automatic key-value validation possible?
  • Index(es):
    • Date
    • Thread