Q:

Filter array of custom objects with a dictionary property

I have an array that holds MyCustomObject objects.
MyCustomObject has 3 properties:
NSString *id;
NSString *name;
NSDictionary *phones;

How do I filter that array by the content of the "phones" property?
All I saw online is:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"phones CONTAINS[c] %@",textField.text];
self.filteredArray = [self.unfilteredArray filteredArrayUsingPredicate:predicate];

But it doesn't help me much...
Thanks

A:

MyCustomObject *value = [[MyCustomObject alloc] init];
for(value in arrayname)
{
    NSString *str = [value.phones objectForKey:@"key"];
    NSRange r = [str rangeOfString:textField.text options:NSCaseInsensitiveSearch];
    if(r.location != NSNotFound)
    {
       NSLog(@"Match found");
    }
}

