HurkNburkS
HurkNburkS

Reputation: 5510

filtered Array Using two Predicates

I was wondering if there is a way to refine a Array using two filteredArrayUsingPredicates, currently I am refining it using one of the values in the array but there are several other values... I would like to know how to do it so i can refine by two of the varaibales.

currently I am doing this

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like %@",@"ISCHARGER",@"T"]; // I have another 
NSArray *filteredArray = [parsedDataArrayOfDictionaries filteredArrayUsingPredicate:predicate];

any help would be greatly appreciated

Upvotes: 0

Views: 300

Answers (1)

Kibitz503
Kibitz503

Reputation: 867

You can just do the following:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"userID == %d AND messageID == %d", currentUser, currentMessage];  

Hope this helps,

Tom

Upvotes: 2

Related Questions