Using a NSCalendar
os anything else, is it possible to get the number of days of the month of a given NSDate
?
views:
60answers:
2
+2
A:
http://stackoverflow.com/questions/1731322/get-all-days-of-any-month-with-objective-c
Duplicate from there apparently, anyways, I'll keep this here.
NSCalendar* a = [NSCalendar currentCalendar];
NSDateComponents* b = [[[NSDateComponents alloc] init] autorelease];
[b setMonth:1]; // The Month
NSRange c = [a rangeOfUnit:NSDayCalendarUnit
inUnit:NSMonthCalendarUnit
forDate:[a dateFromComponents:b]];
// c.length will have the amount of days
Robert
2010-09-21 22:30:59
Thank you very much!
Abramodj
2010-09-21 22:56:03
+1
A:
Is this what you're looking for?
http://stackoverflow.com/questions/1731322/get-all-days-of-any-month-with-objective-c
Computerish
2010-09-21 22:31:28