title: NSPredicate with multiple arguments and "AND behaviour"
body: <p>I have a function which fetches those objects from a particular entity that fulfill a specified criterion:</p>
  
  <pre><code>func fetchWithPredicate(entityName: String, argumentArray: [AnyObject]) -&gt; [NSManagedObject] {
  
      let fetchRequest = NSFetchRequest(entityName: entityName)
      fetchRequest.predicate = NSPredicate(format: "%K == %@", argumentArray: argumentArray)
  
       do {
           return try self.managedContext.executeFetchRequest(fetchRequest) as! [NSManagedObject]
       } catch {
           let fetchError = error as NSError
           print(fetchError)
           return [NSManagedObject]()
       }
  
  }
  </code></pre>
  
  <p>When I pass an array with multiple aguments (multiple attribute names and values) it seems that creates a query like this: </p>
  
  <pre><code>attributeName1 = value1 OR attributeName2 = value2 OR attributeName3 = value3 OR...
  </code></pre>
  
  <p>I would like to change these ORs for ANDs.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The problem was that it was only <a href="https://stackoverflow.com/a/34202476/4688931">replacing the first two items</a> with "%K == %@".</p>
  
  <p>So, I have to create a <a href="https://stackoverflow.com/a/34202601/4688931">NSCompoundPredicate to create a predicate dynamically</a>.</p>