no results for fetchRequest predicate though %@
<p>I have troubles to apply a filter to my core data fetch request. I already checked other posts dealing with the correct implementation of the <em>predicate</em> functionality, but somehow it does not work for me.</p>

<p>I researched the net and I figured out to use <strong>%@</strong> for strings. This is what I did since title (the attribute from entity ITEM) and nameIdentifier are both of data type string.</p>

<p>Maybe I missed something changed for swift 3?</p>

<p>This is my code: </p>

<p><strong>swift 3</strong></p>

<pre><code>func textViewDidEndEditing(_ textView: UITextView) {

 nameIdentifier = textField.text

    // save to Entity
            let fetchRequest: NSFetchRequest&lt;ITEMS&gt; = ITEMS.fetchRequest()

    // check if string has correct value
            print ("NameIdentifier: \(nameIdentifier)") 

            fetchRequest.predicate = NSPredicate(format: "title == %@", nameIdentifier)
            do {
                if let results = try context.fetch(ITEMS.fetchRequest()) as? [ITEMS] {
                    for object in results {

    // check: results of the predicate fetch requests
                            print ("Results: \(object)")
                        }
                    }
                }catch {print ("no results")}
}
</code></pre>

<p>However, the result in my console is not filtered at all. It fetches all data that is already stored:</p>

<p><strong>console output</strong></p>

<pre><code>NameIdentifier: test1

no results &lt;RISK_ITEMS: 0x6000002a63c0&gt; (entity: RISK_ITEMS; id: 0xd000000001c40000 &lt;x-coredata://7687B389-1346-4C27-9B93-99B324FC28D2/RISK_ITEMS/p113&gt; ; data: {
    "title" = test1;
})
no results &lt;RISK_ITEMS: 0x6000002a3120&gt; (entity: RISK_ITEMS; id: 0xd000000001c80000 &lt;x-coredata://7687B389-1346-4C27-9B93-99B324FC28D2/RISK_ITEMS/p114&gt; ; data: {
    "title" = test2;
})
</code></pre>