• 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
Re: sick and not thinking right...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sick and not thinking right...


  • Subject: Re: sick and not thinking right...
  • From: Daniel Jalkut <email@hidden>
  • Date: Tue, 9 Mar 2004 20:33:27 -0800

You should ask your questions in more specific terms - if "something is wrong" with several lines of code, then presumably you know what the symptom is, and which call is failing. You're more likely to get help if people don't have to both figure out what your question is and your answer...

Looking at your code, I would guess that perhaps dateDiff is coming back nil because you're passing an invalid valid for at least the month and day parameters, which must be non-zero, and non-negative, according to the documentation. I think the values you're getting back from "...sinceDate" are going to be negative if start date is older than now.

D

On Mar 9, 2004, at 2:57 PM, email@hidden wrote:

hey all,

this is killing me among other things whats wrong with this?

NSCalendarDate *now = [NSCalendarDate calendarDate];
int hours, minutes, seconds;
[startTime years:NULL months:NULL days:NULL hours:&hours
minutes:&minutes seconds:&seconds sinceDate:now];
NSCalendarDate *dateDiff = [NSCalendarDate dateWithYear:NULL month:NULL
day:NULL hour:hours minute:minutes second:seconds timeZone:[NSTimeZone
systemTimeZone]];
[statusItem setTitle:[dateDiff
descriptionWithCalendarFormat:@"%H:%M:%S"]];

startTime is a previously declared time.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >sick and not thinking right... (From: email@hidden)

  • Prev by Date: What causes this???
  • Next by Date: Re: sick and not thinking right...
  • Previous by thread: sick and not thinking right...
  • Next by thread: Re: sick and not thinking right...
  • Index(es):
    • Date
    • Thread