NSCountedSet
. I'd never heard of this class, but it's described in the Apple docs about Collections (here). Besides the usual charactersthere are several others including:
Let's show off the last one, from PyObjC. Here's the listing:
and the output:
It feels a bit strange, not only can you get the
count
of an object that's not in the set (as in Python), but as the docs say:removeObject:
does nothing if anObject is not present in the set