title: How to use both predicates and sortdecriptor in coredata
body: <p>I am using 'sortdescriptor' for fetching 'nsmutablearray',its sorted by creation date but the problem its is not filtering by predicate.I want to apply both sort and filter.i have tried with following</p>
  
  <pre><code>let fetchRequest = NSFetchRequest&lt;NSManagedObject&gt;(entityName: entityName)
      let sort = NSSortDescriptor(key: "date", ascending: false)
      let pre:NSPredicate = NSPredicate(format: "id == %d", 100)
      fetchRequest.predicate = pre
      fetchRequest.sortDescriptors = [sort]
  </code></pre>