0

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

2
  • 1
    Do you mean you want some compound predicates like NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(lastName like[cd] %@) AND (birthday > %@)", lastNameSearchString, birthdaySearchDate];? (which is in Predicate Programming Guide) Commented Aug 2, 2012 at 23:09
  • yes that is what I mean... I totally should have checked out the documents but didn't even think... sorry about that. Commented Aug 2, 2012 at 23:12

1 Answer 1

2

You can just do the following:

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

Hope this helps,

Tom

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.