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

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -