2

I have the following array of data:

NSArray *denoms = [NSArray arrayWithObjects:@"$1", @"$1.5", @"$2", @"c2.5", @"c10", @"$100", @"$51", nil];

If I try to search following string in array then it should return me the exact values out of the array if exist.

For e.g. @"$1,$100" then result should be

$1
$100

How to filter in this way?

2 Answers 2

5
NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF IN %@", @"$1,$100"];

I used to get the solution while posting the question. So keep it for future references.

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

Comments

0

this is code. it is working for me

NSPredicate* predicate = [NSPredicate predicateWithFormat:filter, @"SELF", @"a"];

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.