I'm looking for a way to use NSPredicate
to set a LIKE
condition to fetch objects. In addition to that, an OR
would be useful as well. I'm trying to do something where if a user searches "James" I can write an NSPredicate
that will do the equivalent of:
select * from users where firstname LIKE '%James%' OR lastname LIKE '%James%';
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…