I am using a NSDictionary that itself contains dictionaries some keys and its values.The format is like ,
{
"1" = {
"key1" = "ss",
"key2" = "rr",
"name" = "nm"
},
"2" = {
"key1" = "tt",
"key2" = "vv",
"name" = "gf"
},
"3" = {
"key1" = "nm",
"key2" = "vv",
"name" = "gf"
},
"4" = {
"key1" = "tt",
"key2" = "vv",
"name" = "gf"
},
}
I need to filter with the case that key1 should be "tt" and key2 should "vv" using NSPredicate.
You can use
keysOfEntriesPassingTest
method ofNSDictionary
.Eg.
Reference : Apple Doc
Assume that
Now you can filter by the following way:
try this to check:
try this really helpful to you.
This works. You can set your own values here.
Output:
For clearer explanation:
Output: