I have an NSArray full of NSDictionary objects. Each dictionary object has a key:value:
color: red
Amongst other keys… color could be one of many colors that are user generated.
I would like to be able to extract each color and count how many I have of each, so:
red: 3 dictionaries
yellow: 4 dictionaries
etc… How exactly would this be possible? Just iterate through the dictionaries until you find a unique color, then search the array using NSPredicate again for that color, rinse, repeat?
You could just maintain a dictionary mapping color to the number of dictionaries with that color. For example: