24 Collection Classes
A collection class is one whose instances hold pointers to other objects. You have already used two collection classes: NSArray and its subclass NSMutableArray. In this chapter, you will delve deeper into arrays and learn about some other collection classes: NSSet/NSMutableSet and NSDictionary/NSMutableDictionary.
NSSet/NSMutableSet
A set is a collection that has no sense of order, and a particular object can only appear in a set once.
Sets are primarily useful for asking the question “Is it in there?” For example, you might have a set of URLs that are not child-appropriate. Before displaying any web page to a child, you would do a quick check to see if the URL is in the set. Sets are faster at ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access