Collections

Collections are an essential component of most applications, and the Foundation framework provides rich collection classes to meet most needs. All the collection classes take advantage of Cocoa’s reference-counted memory management conventions and the power of Objective-C. The Foundation collection classes are able to store any type of object that conforms to the NSObject protocol. The collections even store heterogeneous objects. In other words, a single collection object stores many different classes of objects at the same time.

The Foundation framework includes classes for arrays, dictionaries, and sets. Arrays provide ordered storage that enables random access to stored elements via an index specifying a position within the collection. ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.