Re: 10.4 NSDateFormatter format strings
Re: 10.4 NSDateFormatter format strings
- Subject: Re: 10.4 NSDateFormatter format strings
- From: SA Dev <email@hidden>
- Date: Mon, 12 Sep 2005 16:24:04 -0400
(sigh) Nice.
I *thought* I knew how to instantiate a date formatter. I didn't
realize that too had changed. :-) I think it comes down to not
realizing the extent of the changes to NSDateFormatter (and not
reading the parts of the doc I had read before). After a thorough re-
read, I just found the following in the
"initWithDateFormat:allowNaturalLanguage:" method description:
"Initializes and returns an NSDateFormatter instance that uses the
Mac OS X v10.0 formatting behavior and the date format string,
format, in its conversions."
Lesson learned.
Anyway, it's formatting properly now, but with the following side
effect: When I change the text field that contains the date format
(which is bound to my model's "dateFormat" string attribute), the
format of the date in the date field is not updated until the field
gains focus.
I tried putting the following in my class' +initialize method:
[self setKeys:[NSArray arrayWithObject:@"dateFormat"]
triggerChangeNotificationsForDependentKey:@"date"];
This didn't help. What's the cleanest way around this problem?
On Sep 12, 2005, at 2:31 PM, mmalcolm crawford wrote:
On Sep 12, 2005, at 9:14 AM, SA Dev wrote:
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];
<http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Classes/NSDateFormatter.html#//apple_ref/
doc/uid/20000447-401>
See "Class Description".
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net
This email sent to email@hidden
_______________________________________________
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