There’s no way this question hasn’t been asked before but I cannot find a clear answer anywhere.
I have Core Data entities that have optional ‘Integer 32’ attributes. I’m trying to setup a predicate to retrieve all objects where that attribute equals zero but is not null.
attributes.power == nil AND attributes.power == 0
That’s not doing the job. This is returning no results. Removing the first half of the compound predicate returns zeros and nulls.
Any help is greatly appreciated.
This may be a simple typo, but I believe you want the predicate