NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
NSUInteger unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponents *components = [gregorian components:unitFlags
fromDate:dateBegin
toDate:dateEnd options:0];
totalDays = [components day];
That not gives me the total days between the 2 dates but simple the difference between the 2 days of the 2 dates. it dateBegin is 8 sep 2012 and dateEnd is 10 nov 2012 the result is 2! Why ?
Change your bellow line
to