Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

forrestgrant

macrumors member
Original poster
Jun 24, 2008
34
0
When I set this variable:
Code:
NSCalendarDate *calInfo = [NSCalendarDate date];
I get this error when I try to build:
Code:
error: 'NSCalendarDate' undeclared (first use in function)

Why is it treating it as a newly declared variable instead of the class that it is?
 

MacDonaldsd

macrumors 65816
Sep 8, 2005
1,005
0
London , UK
When I set this variable:
Code:
NSCalendarDate *calInfo = [NSCalendarDate date];
I get this error when I try to build:
Code:
error: 'NSCalendarDate' undeclared (first use in function)

Why is it treating it as a newly declared variable instead of the class that it is?

NSCalenderDate is not supported on the iPhone, you have to use NSDate.
 

forrestgrant

macrumors member
Original poster
Jun 24, 2008
34
0
THIS is why Apples development program is a load of crap. Some emulator they have... supporting unavailable Classes.
 

forrestgrant

macrumors member
Original poster
Jun 24, 2008
34
0
In that case... Here is what my NSCalendarDate was doing:
Code:
	NSCalendarDate *calInfo = [NSCalendarDate date];
	[calInfo setCalendarFormat:@"%y"];

This would set calInfo equal to 08. NSDate does not respond to setCalendarFormat.

Ideas?
 

MacDonaldsd

macrumors 65816
Sep 8, 2005
1,005
0
London , UK
This would set calInfo equal to 08. NSDate does not respond to setCalendarFormat.

Ideas?

I expect you have already worked out that you should be using NSDateFormatter. I agree Apple are being a bit stupid about having classes work in the simulator, and not on the handset. If its any conciliation there deprecating NSCalendarDate in OS X as well.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.