A set is a collection of unique objects, and it can be mutable or immutable. Operations include searching, adding, and removing members (mutable sets); comparing two sets; and finding the intersection and union of two sets.
In this section, we take a quick look at three set classes:
NSIndexSet. We also mention the class
NSCountedSet in passing so that you will know when you might need or want to use that set.
Program 15.19 shows some basic operations on sets. Suppose, for instance, that you want to display the contents of your sets several times during execution of the program. You therefore decide to create a new method called
NSSet class by creating a new category ...