any one have a solution for that.
thanks
any one have a solution for that.
thanks
Workaround Function:
-(int)GetLastDayOfMonth:(NSDate *)date
{
int last_day = 27;
NSCalendar *cal=[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *compsMonth = [cal components:NSWeekdayCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:date];
[compsMonth setDay:last_day];
int month = [compsMonth month];
while(TRUE){
[compsMonth setDay:last_day+1];
NSDate *dateFuture = [cal dateFromComponents:compsMonth];
NSDateComponents *futureComps = [cal components:NSWeekdayCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:dateFuture];
if(month != [futureComps month]){
return last_day;
}
last_day+=1;
}
return last_day;
}