• 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
Re: NSDateFormatter not validating input
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter not validating input


  • Subject: Re: NSDateFormatter not validating input
  • From: Joakim Danielson <email@hidden>
  • Date: Wed, 30 Jun 2004 11:41:11 +0200

I just tested your problem in my application and it seems like the key-value validation method gets called before any formatting occurs. So if your class is KVC compliant, just implement a validate<key> method in your class and validate the date there. If your using bindings you can check 'Validates immediately' in the info panel otherwise you have to call the method yourself.

See file:///Developer/Documentation/Cocoa/Conceptual/KeyValueCoding/ Concepts/Validation.html#//apple_ref/doc/uid/20002173 for a better description of key-value validation.

In my personal opinion this validation should be performed by NSDateFormatter directly.

Joakim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSDateFormatter not validating input
      • From: Joakim Danielson <email@hidden>
References: 
 >NSDateFormatter not validating input (From: David Alter <email@hidden>)

  • Prev by Date: 'Attributes' tab in IB inspector
  • Next by Date: Re: NSDateFormatter not validating input
  • Previous by thread: Re: NSTextViews with embedded pictures and vertical alignment
  • Next by thread: Re: NSDateFormatter not validating input
  • Index(es):
    • Date
    • Thread