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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to