title: How to sort NSDate by date descending, but with time ascending within that date?
body: <p>I am successfully sorting using an NSFetchedResultsController and a NSSortDescriptor into a table, with a section for each date, so that today's date appears first (descending date order).</p>
  
  <p>However, within that section, I would like the time to be sorted in ascending order.</p>
  
  <p>This is my current code without sorting by time:</p>
  
  <pre><code>//Set up the fetched results controller.
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription entityForName:kEntityHistory inManagedObjectContext:global.managedObjectContext];
  fetchRequest.entity = entity;
  
  // Sort using the timeStamp property..
  NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO];
  NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
  
  fetchRequest.sortDescriptors = sortDescriptors;
  
  //The following is from:
  //http://stackoverflow.com/questions/7047943/efficient-way-to-update-table-section-headers-using-core-data-entities
  
  NSString *sortPath = @"date.dayDate";
  
  self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:global.managedObjectContext sectionNameKeyPath:sortPath cacheName:nil];
  
  fetchedResultsController.delegate = self;
  </code></pre>
  
  <p>How would it be possible to change the code to add sorting by time ascending within this date section please?</p>