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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -