ios - Proper use of NSPredicate to retrieve data -


as first attempt guide me , tell me doing wrong. after several tutorials i've tried create mechanism displays search results according user's input. app searching in array multiple element objects:

@interface element : nsobject{      nsinteger id;     nsstring *ename;     nsinteger ecategory;     nsstring *edescription;     addressbook *eaddress; } 

i using code below:

- (void)filtercontentforsearchtext:(nsstring*)searchtext scope:(nsstring*)scope{      nspredicate *resultpredicate = [nspredicate                                     predicatewithformat:@"(ename contains[cd] %@)",                                     searchtext];      searchresults = [allelements filteredarrayusingpredicate:resultpredicate]; } 

my problem that, results not expecting. returns elements ename not match searchtext have noticed given text appeared in edescription!

how above can modified in order given text in ename of element?


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -