• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
problem with date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: problem with date
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: NSMessagePort/NSSocketPort & Distributed Objects
  • Next by Date: Re: problem with date
  • Previous by thread: Re: NSMessagePort/NSSocketPort & Distributed Objects
  • Next by thread: Re: problem with date
  • Index(es):
    • Date
    • Thread