title: Compare two NSDates for same date/time
body: <p>Is <code>date1 == date2</code> not a valid way to compare?  If not, what is the correct alternative?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>- (NSDate*) dateWithNoTime {
      unsigned int flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
      NSCalendar* calendar = [NSCalendar currentCalendar];
      NSDateComponents* components = [calendar components:flags fromDate:self];
      NSDate* dateOnly = [calendar dateFromComponents:components];
      return dateOnly;
  }
  
  - (BOOL) sameDayAsDate:(NSDate*)dateToCompare {
      NSDate *date1 = [self dateWithNoTime];
      NSDate *date2 = [dateToCompare dateWithNoTime];
      return date1 == date2;       // HERE IS WHERE THINGS SEEM TO FAIL
  
  }
  </code></pre>