I have use codedate, I want to use NSPredicate to filter the result. I have a entity, there are three field: from and to. For example:
from to info
aa bb 11111
aa cc y6767
bb aa 4545
bb dd 3434
So I want to get from=aa and to=bb or from =bb and to=aa, so the result is:
from to info
aa bb 11111
bb aa 4545
NSPredicate *predicate = [NSPredicate predicateWithFormat:@”(from ==
%@) AND (to > %@) OR (from == %@) and (to == %@)”,from, to,to ,from];or NSPredicate *predicate = [NSPredicate predicateWithFormat:@”(from
== %@) AND (to > %@) OR ((from == %@) and (to == %@))”,from, to,to ,from];
Try