Example:
NSArray *names = [NSArray arrayWithObjects:@"John", @"Jane", @"John", nil];
NSCountedSet *set = [[NSCountedSet alloc] initWithArray:names];
for (id item in set) {
NSLog(@"Name=%@, Count=%lu", item, (unsigned long)[set countForObject:item]);
}