Core data query value "is not nil" is not returning object with value equal 0
<p>I try to return objects (Measure) where property <code>rawValue</code> is not nil. My predicate is:</p>

<pre><code>myPredicate = NSPredicate(format: "rawValue != %@", "nil")
</code></pre>

<p><strong>And my request</strong></p>

<pre><code>let fetchRequest = NSFetchRequest(entityName:"Measure")

    fetchRequest.predicate = predicate

    do {
        let fetchResults = try managedObjectContext?.executeFetchRequest(fetchRequest) as? [Measure]
        if fetchResults!.count &gt; 0{
            measuresFetched = fetchResults!
        }
    } catch let error as NSError {
        print("Fetch failed: \(error.localizedDescription)")
    }
</code></pre>

<p>The problem is that my query is not returning objects with <code>rawValue</code> = 0. And for me 0 is not nil.</p>

<p><strong>My objects looks like below</strong></p>

<pre><code>class Measure: NSManagedObject{

    @NSManaged var rawValue: NSNumber?
    @NSManaged var date: NSDate

    class func createInManagedObjectContext(moc: NSManagedObjectContext,rawValue: Double?, date: NSDate) -&gt; Measure {
        let newItem = NSEntityDescription.insertNewObjectForEntityForName("Measure", inManagedObjectContext: moc) as! Measure
        newItem.rawValue = rawValue
        newItem.date = date
        return newItem
    }

}
</code></pre>

<p>How can I return all objects where rawValue is not nil ?</p>