Instead of iterating over the collection yourself, you can also ask the dictionary to filter the results for you and return the array using NSPredicate.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith www_"];
NSArray *filtered = [[dictionary allKeys] filteredArrayUsingPredicate:predicate];
Just a thought.
source
share