10.4 NSDateFormatter format strings
10.4 NSDateFormatter format strings
- Subject: 10.4 NSDateFormatter format strings
- From: SA Dev <email@hidden>
- Date: Mon, 12 Sep 2005 12:14:39 -0400
List:
I'm having difficulties adjusting to the new ICU string format
referenced by the NSDateFormatter docs. I want to display a four-
digit year and the era. I'm creating a formatter like this:
NSDateFormatter * df = [[[NSDateFormatter alloc]
initWithDateFormat:@"yyyy G" allowNaturalLanguage:YES] autorelease];
I'm then assigning the formatter to my NSTextField like this:
[dateField setFormatter:df];
My objects (whose dates are being displayed by the date field)
have a default date value of today just for testing purposes, like
[NSDate date]. The date field's value is bound to the current
object's date property. (Note, without the bindings established, the
date's description string is shown, so things are bound properly).
I'm creating and assigning the formatter programmatically so I can
change the formatter's format string on the fly.
The problem is, when the app is run with the formatter in place,
the date format string is displayed (ie, "yyyy G") rather than the
formatted date itself.
What have I done wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden