title: How to get number of days between two dates objective-c
body: <p>I'm trying to make a label that says how many days left till event. I want to calculate the difference between todays date and the events date. I'm using this code and its giving me -4600. It works fine till I use todays date.</p>
  
  <pre><code>NSDateFormatter *f = [[NSDateFormatter alloc] init];
      [f setDateFormat:@"yyyy-MM-dd"];
      NSDate *startDate = [NSDate date];
      NSDate *endDate = [f dateFromString:end];
      NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
      NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit
                                                          fromDate:startDate
                                                            toDate:endDate
                                                           options:0];
      return components.day;
  return components.day;
  </code></pre>