Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
This compiler warning 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:' is driving me up the wall. I don't understand why I am getting the warning because, by all indications, +dateWithTimeInterval:sinceDate: has not been deprecated. I would be extremely grateful for any insight. Here's my code: NSDate *dateWithoutHundredths; dateWithoutHundredths = [NSDate dateWithString:[NSString stringWithFormat:@%04d-%02d-%02d %02d:%02d:%02d +, year, month, day, hour, minutes, seconds]]; NSTimeInterval hundredthsToAdd = (double)(hundredth / 100.0); date = [NSDate dateWithTimeInterval:hundredthsToAdd sinceDate:dateWithoutHundredths]; //This is the line the warning shows up on ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
On Mar 26, 2010, at 01:23, Alec Stewart wrote: date = [NSDate dateWithTimeInterval:hundredthsToAdd sinceDate:dateWithoutHundredths]; //This is the line the warning shows up on The NSDate class reference states that this is available in Mac OS 10.6 or later. Chances are your project is targeting the 10.5 SDK, in which this method doesn't exist. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
On Mar 26, 2010, at 1:23 AM, Alec Stewart wrote: This compiler warning 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:' is driving me up the wall. Quincey already answered why you are likely getting this error, but you can use -initWithTimeInterval:sinceDate: with to create an NSDate that you can use instead. Just don't forget to release or autorelease the object when your done. -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
Thanks very much! That took care of the problem. On Fri, Mar 26, 2010 at 10:12 AM, David Duncan david.dun...@apple.comwrote: On Mar 26, 2010, at 1:23 AM, Alec Stewart wrote: This compiler warning 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:' is driving me up the wall. Quincey already answered why you are likely getting this error, but you can use -initWithTimeInterval:sinceDate: with to create an NSDate that you can use instead. Just don't forget to release or autorelease the object when your done. -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
According to the docs, that method is only available in 10.6 and later. Are you building for 10.5? http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/doc/uid/2188-SW14 -nick -- Nick Peelman n...@peelman.us On Fri, Mar 26, 2010 at 4:23 AM, Alec Stewart a...@velocitek.com wrote: This compiler warning 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:' is driving me up the wall. I don't understand why I am getting the warning because, by all indications, +dateWithTimeInterval:sinceDate: has not been deprecated. I would be extremely grateful for any insight. Here's my code: NSDate *dateWithoutHundredths; dateWithoutHundredths = [NSDate dateWithString:[NSString stringWithFormat:@%04d-%02d-%02d %02d:%02d:%02d +, year, month, day, hour, minutes, seconds]]; NSTimeInterval hundredthsToAdd = (double)(hundredth / 100.0); date = [NSDate dateWithTimeInterval:hundredthsToAdd sinceDate:dateWithoutHundredths]; //This is the line the warning shows up on ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/peelman%40gmail.com This email sent to peel...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Compiler Warning: 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:'
On Mar 26, 2010, at 1:23 AM, Alec Stewart wrote: This compiler warning 'NSDate' may not respond to '+dateWithTimeInterval:sinceDate:' is driving me up the wall. I don't understand why I am getting the warning because, by all indications, +dateWithTimeInterval:sinceDate: has not been deprecated. I would be extremely grateful for any insight. Here's my code: NSDate *dateWithoutHundredths; dateWithoutHundredths = [NSDate dateWithString:[NSString stringWithFormat:@%04d-%02d-%02d %02d:%02d:%02d +, year, month, day, hour, minutes, seconds]]; NSTimeInterval hundredthsToAdd = (double)(hundredth / 100.0); date = [NSDate dateWithTimeInterval:hundredthsToAdd sinceDate:dateWithoutHundredths]; //This is the line the warning shows up on Tech notes say: + (id)dateWithTimeInterval:(NSTimeInterval)secondssinceDate:(NSDate *)date Is only available in OS X 10.6 and higher. If your compiler Base SDK is set for 10.5, then that is probably the issue. As an alternative, you can use a 10.0 compatible function: - (id)initWithTimeInterval:(NSTimeInterval)seconds sinceDate:(NSDate *)refDate___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com