Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter not validating input



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.


References: 
 >NSDateFormatter not validating input (From: David Alter <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.