• 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
[NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5


  • Subject: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
  • From: Stephane Sudre <email@hidden>
  • Date: Mon, 22 Nov 2010 17:05:29 +0100

According to the NSDate.h header:

- (id)dateByAddingTimeInterval:(NSTimeInterval)ti
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

Problem is when I run the following code on Mac OS X 10.5 on a
PowerMac G5, I get the result listed below.

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSLog(@"dateByAddingTimeInterval: %@",[[NSDate date]
dateByAddingTimeInterval:24*60*60]);

    NSLog(@"addTimeInterval: %@",[[NSDate date] addTimeInterval:24*60*60]);
    [pool drain];
    return 0;
}


$ ./TestAPIDate
2010-11-22 16:59:15.900 TestAPIDate[4192:10b]
dateByAddingTimeInterval: 2020-10-13 09:58:31 +0200
2010-11-22 16:59:15.901 TestAPIDate[4192:10b] addTimeInterval:
2010-11-23 16:59:15 +0100

So it looks like this API is broken on Mac OS X 10.5 and should not be
said to be available for Mac OS X 10.5 in the 10.5 SDK Headers.

Am I missing something obvious? (I will file a bug report later if I'm
not missing anything).
_______________________________________________

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: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
      • From: Jeff Johnson <email@hidden>
  • Prev by Date: Re: Core data fetch and multithreading
  • Next by Date: Re: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
  • Previous by thread: NSTextView auto_refcount_underflow_error during spell check
  • Next by thread: Re: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5
  • Index(es):
    • Date
    • Thread