NSDateFormatter not validating input
NSDateFormatter not validating input
- Subject: NSDateFormatter not validating input
- From: David Alter <email@hidden>
- Date: Tue, 29 Jun 2004 13:16:46 -0700
I'm having some problems with NSDateFormatter filtering dates correctly
on input. I have NSTextField that I have set the formatter to an
NSDateFormatter. Seeing how I want to use this for data input I have
not been very impressed with the NSDateFormatters ability to validate
input. For example if I enter 33/44/9999 it happily converts that to
5/3/92. Should I only use NSDateFormatter for out put. Any suggestion
on how to manage data input. Please keep in mind I will need to support
multiple languages and the differences in dates associated with that.
Here is what I'm doing
NSUserDefaults *the_UserDefaults = [NSUserDefaults
standardUserDefaults];
NSDictionary *the_DefaultsDictionary = [the_UserDefaults
dictionaryRepresentation];
NSDateFormatter *the_pDateFormatter = [[NUIDateFormatter alloc]
initWithDateFormat:[the_DefaultsDictionary objectForKey:
NSShortDateFormatString] allowNaturalLanguage: YES];
[mDate setFormatter: the_pDateFormatter];
thanks for the help
-dave
_______________________________________________
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.