ios - Compound Predicate -
i'm trying compound search on core data via uitableview
(search , display controller):
let firstnamepredicate = nspredicate(format: "fname contains[c] %@", searchtext) let lastnamepredicate = nspredicate(format: "lname contains[c] %@", searchtext) let firstandlastnamepredicate = nspredicate(format: "fname contains[c] %@ or lname contains[c] %@", searchtext, searchtext) let companypredicate = nspredicate(format: "company contains[c] %@", searchtext) let predicate = nscompoundpredicate(type: nscompoundpredicatetype.orpredicatetype, subpredicates: [firstnamepredicate, lastnamepredicate, companypredicate, firstandlastnamepredicate]) fetchrequest.predicate = predicate
all of predicates work except first , last name predicate. can type first name in , results perfectly, space , type last name i'll no results. idea what's wrong first , last name predicate?
Comments
Post a Comment