problem with date
problem with date
- Subject: problem with date
- From: H M <email@hidden>
- Date: Sat, 15 Sep 2007 20:48:18 +0100
hi.
i'm still working on the same project with the view that didn't
update. that problem is solved, but I have a new one:
I want to display the time in the window, both as local time
(systemTimeZone) and as GMT. I have the following code which is
called every time the view updates:
- (void)doTime {
NSString *testString;
NSString *format = @"%H:%M:%S";
NSTimeZone *GMTZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
NSCalendarDate *now = [NSDate date];
[now setCalendarFormat:format];
testString = [now description];
NSLog(testString);
}
when I try to run this, I get the following in the run log window:
[Session started at 2007-09-15 20:43:22 +0100.]
2007-09-15 20:43:24.417 Astro[905] *** -[NSCFDate
setCalendarFormat:]: selector not recognized [self = 0x342f00]
2007-09-15 20:43:24.419 Astro[905] An uncaught exception was raised
2007-09-15 20:43:24.419 Astro[905] *** -[NSCFDate
setCalendarFormat:]: selector not recognized [self = 0x342f00]
2007-09-15 20:43:24.419 Astro[905] *** Uncaught exception:
<NSInvalidArgumentException> *** -[NSCFDate setCalendarFormat:]:
selector not recognized [self = 0x342f00]
when I turn the [now setCalendarFormat:format]; line into a comment,
the code runs, but then the string is in the default format which is
not what I want. BTW, I have code sense on, so I know I didn't put
any typos in that line.
I can't figure out what's going on here. can anyone help me out? is
the format string FUBAR?
--
GPG Key ID: 92AD877F7E4E32B9
Fingerprint: 16B0 7DCD 3AB0 0C45 F5FD 581D 92AD 877F 7E4E 32B9
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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