I have a model class that has "name" and "description". I would to perform a search using valueForKeyPath.
For example, using loop I would perform the search this way:
for (Model model in allModels) {
if (mode.name == "name" || [absoluteURL rangeOfString:@"my_substring"].location == NSNotFound ) {
// put this model in a result list
}
}
Now, how do I do the same with something like this?
NSArray *result = [allModels valueForKeyPath: @"[collect].{name == @"name"}”];