ios - NSPredicate apply predicate on an Object within an object array. -


i have array, containing objects of order item class, , in each order item there article object in it, contains details.

now want order items have specific name in article of individual order item. how should write nspredicate?

what trying like:

   nspredicate *predicate = [nspredicate predicatewithformat:@"self.itemarticle.articlename contains[c] '%@'", searchstring];    nsarray *resultsarray = [allorderitemarray filteredarrayusingpredicate: predicate]; 

try removig both self. part , single quotes place holder (and close double quotes).

nspredicate *predicate = [nspredicate predicatewithformat:@"itemarticle.articlename contains[c] %@", searchstring]; nsarray *resultsarray = [allorderitemarray filteredarrayusingpredicate: predicate]; 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -