• 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
-dateWithTimeIntervalSinceNow: 64-bits may overflow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-dateWithTimeIntervalSinceNow: 64-bits may overflow


  • Subject: -dateWithTimeIntervalSinceNow: 64-bits may overflow
  • From: Jerry Krinock <email@hidden>
  • Date: Sat, 08 Oct 2011 21:09:15 -0700

Don't do this:

    -[NSDate dateWithTimeIntervalSinceNow:FLT_MAX] ;

Expected result: A date far off into the future which will always behave as though it is later than or equal to any other date.

No problem ever in 32-bit executable.

In 64-bit, -[NSDate compare:] and -[NSDate laterDate:] still work as expected.  But other methods may not.  For example, -[NSConditionLock lockWhenCondition:beforeDate:] seems to think that such a "float max date" has already past and returns NO immediately, regardless of its 'condition'.

I filed a bug, 10256461, but am posting here because I suppose Apple may consider this to be a programming error and not a bug.

_______________________________________________

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: -dateWithTimeIntervalSinceNow: 64-bits may overflow
      • From: Sean McBride <email@hidden>
    • Re: -dateWithTimeIntervalSinceNow: 64-bits may overflow
      • From: "Stephen J. Butler" <email@hidden>
  • Prev by Date: Re: dataWithBytesNoCopy:length:freeWhenDone
  • Next by Date: Re: -dateWithTimeIntervalSinceNow: 64-bits may overflow
  • Previous by thread: Re: return NO in tableViewSelectionDidChange: disables button cell
  • Next by thread: Re: -dateWithTimeIntervalSinceNow: 64-bits may overflow
  • Index(es):
    • Date
    • Thread