Reputation: 51
I have what I thought would be an easy thing to do / find on the Google-verse but have been totally baffled. I have a single object with two date properties setup in Core Data. I want to grab a list of objects where the two dates are not the same. How can I do this using Core Data?
[NSPredicate predicateWithFormat:@"dateModified != dateCreated"];
does not work.
Upvotes: 5
Views: 526
Reputation: 7154
The format you are using is searching for a key-value relation, but you have keys on both sides, dateModified
and dateCreated
. Try something like this:
[NSPredicate predicateWithFormat:@"(dateModified != %@)", someObject.dateCreated]
Upvotes: 1