Re: NSDateFormatter problem using NSShortDateFormatString
Re: NSDateFormatter problem using NSShortDateFormatString
- Subject: Re: NSDateFormatter problem using NSShortDateFormatString
- From: Will Cosgrove <email@hidden>
- Date: Mon, 16 Sep 2002 21:22:35 -0500
Hi Robert,
Thanks for the reply.
(You can simply do it by sending [icValueField setFormatter:nil]).
Also, I would recommend to create a new NSCalendarDate instance and
fill the icValueField programatically, just to check your formatter.
Ok, it accepts the NSCalendarDate and formats it correctly. If I set
the date format to day/month/year and set the date with NSCalendarDate
it again works, but if I try to enter a date manually in the text field
it won't accept it no matter what format it's in. Thoughts? It acts
like a bug to me.
Cheers,
Will
NSString *format;
NSDateFormatter *formatter;
format = [[NSUserDefaults standardUserDefaults]
stringForKey:NSShortDateFormatString];
formatter = [[NSDateFormatter alloc] initWithDateFormat:format
allowNaturalLanguage:YES];
//attach to editfield
[icValueField setObjectValue:[NSCalendarDate date]];
[icValueField setFormatter:nil];
[icValueField setFormatter: formatter];
_______________________________________________
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.