title: Sorting CoreData in reverse chronological order with NSSortDescriptor
body: <p>I have a Core Data database set up with a tableview and I'm trying to set it up where the the objects displayed in the table view are displayed in reverse chronological order. I'm trying to do this with NSSortDescriptor but can't figure out how to order it in reverse chronological order. Any ideas? Thanks.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>func getCoreData(){
  
          var appDel : AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate
          var context : NSManagedObjectContext = appDel.managedObjectContext!
          var req : NSFetchRequest = NSFetchRequest(entityName: "KeptQuotes")
  
          var s = NSSortDescriptor(key: "quote", ascending: true)
          req.sortDescriptors = [s]
  
          var error : NSError?
  
          let fetchedResults = context.executeFetchRequest(req, error: &amp;error) as [NSManagedObject]?
  
  
          if let results = fetchedResults {
  
              keptQuotes = results
  
          }else{
  
              println("Could not fetch \(error), \(error!.userInfo)")
  
          }
  
          tableView.reloadData()
  
      }
  </code></pre>