Re: NSDateFormatter weekdaySymbols
Re: NSDateFormatter weekdaySymbols
- Subject: Re: NSDateFormatter weekdaySymbols
- From: Ricky Sharp <email@hidden>
- Date: Mon, 2 Apr 2007 20:45:38 -0500
On Apr 2, 2007, at 7:46 PM, Nicholas Meyer wrote:
Is there a way to automatically populate weekdaySymbols in an
NSDateFormatter instance?
If I create a new DateFormatter and call weekdaySymbols, the
returned array is empty. Explicitly setting the locale and
formatting styles yields no different result.
What's your exact code?
The following works well for me (weekdaySymbols is for 10.4 and
later; I ran this on 10.4.9):
NSDateFormatter* theDateFormatter = [[[NSDateFormatter alloc] init]
autorelease];
[theDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
NSLog (@"%@", [theDateFormatter weekdaySymbols]);
[theDateFormatter setLocale:[[NSLocale alloc]
initWithLocaleIdentifier:@"fr_FR"]];
NSLog (@"%@", [theDateFormatter weekdaySymbols]);
output:
(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday)
(dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi)
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden