Ext.: http://www.cnblogs.com/kingbo/p/3966855.html
1get the current month how many days Nscalendar*calendar =[Nscalendarcurrentcalendar]; Nsrange Range=[Calendarrangeofunit:nsdaycalendarunitinunit:nsmonthcalendarunitfordate:[nsdatedate]]; Nsuinteger Numberofdaysinmonth=range.length; Numberofdaysinmonth is the number of days in the month. More usage view Nscalendar, nsdatecomponents Help documentation2. Gets the current year and month and the number of days Nscalendar*calendar =[Nscalendar Currentcalendar]; unsigned unitflags= Nsyearcalendarunit | Nsmonthcalendarunit |Nsdaycalendarunit; Nsdatecomponents*components =[Calendar components:unitflags fromdate:[nsdate Date]]; Nsinteger Icuryear= [Components year];//the current yearNsinteger Icurmonth= [Components month];//the current monthNsinteger Icurday= [Components day];//the current numbered
IOS gets the number of days in the current month (RPM),