ios - Filter NSArray with NSPredicate gives always null -


i'm having following core data entities:

enter image description here

now have nsarray poi entities.

i want filter array predicate searches on every attribute has see if contains user searches.

for example: array object 0 : address = test details = test1 ..

array object 1: address = ba details = ba1 ..

and users searches 'e', want nsarray object 0.

i tried this:

nspredicate *resultpredicate = [nspredicate                                 predicatewithformat:@"self contains[cd] %@",                                 searchtext];   searchresults = [_dataarray filteredarrayusingpredicate:resultpredicate]; 

but returns nothing.

can me out on this?

please try this;

[nspredicate predicatewithformat:@"self.propertyname contains[cd] %@", searchtext]; 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -