title: What is the best way to build a complex NSCompoundPredicate?
body: <p>I need to build an <code>NSPredicate</code> with many pieces of data.  For example in SQL I would do something like the following:</p>
  
  <pre><code>SELECT * 
    FROM TRANSACTIONS
    WHERE CATEGORY IN (categoryList)
      AND LOCATION IN (locationList)
      AND TYPE IN (typeList)
      AND NOTE contains[cd] "some text"
      AND DATE &gt;= fromDate
      AND DATE &lt;+ toDate
  </code></pre>
  
  <p>I'm struggling with how to build this as an <code>NSPredicate</code> for use with Core Data.  I've read the documentation... which only provides simplistic examples.  If anybody can point me to a more complex example I would certainly appreciate it.</p>
  
  <hr>
  
  <p>Well, I had an answer out here for two years that many people found helpful.  My post was deleted.  Here is the updated URL with the solution.</p>
  
  <p><a href="https://www.radeeccles.com/convert-sql-statement-to-an-nspredicate-for-use-with-core-data/" rel="nofollow noreferrer">https://www.radeeccles.com/convert-sql-statement-to-an-nspredicate-for-use-with-core-data/</a></p>