ios - Filter NSArray with NSPredicate gives always null -
i'm having following core data entities:
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
Post a Comment