title: ios - get in between dates (in actual date, not number of days)
body: <p>I have two date string and I wanted to get the in between dates.
  For example,</p>
  
  <pre><code>NSString *startDate = @"25-01-2014";
  NSString *endDate = @"02-02-2014";
  </code></pre>
  
  <p>In between dates will be (26-01-2014, 27-01-2014, 28-01-2014.......)
  preferably include <code>startDate</code> and <code>endDate</code> as well. Most of the question I managed to find asked for number of days. But I needed it to be actual date. Is there anyway that I can get the in between dates? </p>
  
  <pre><code>NSString *start = @"2010-09-01";
  NSString *end = @"2010-12-05";
  
  NSDateFormatter *f = [[NSDateFormatter alloc] init];
  [f setDateFormat:@"yyyy-MM-dd"];
  NSDate *startDate = [f dateFromString:start];
  NSDate *endDate = [f dateFromString:end];
  
  NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit
                                                      fromDate:startDate
                                                        toDate:endDate
                                                       options:0];
  
  NSLog(@"Difference in date components: %d", components.day);
  </code></pre>
  
  <p>I managed to find this which only returns number of days difference. </p>