O'Reilly logo

Cocoa Design Patterns by Donald A. Yacktman, Erik M. Buck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8. Enumerators

Enumerators provide a mechanism for accessing all of the objects in a collection sequentially without exposing the collection’s underlying data structures. Enumerators are used to write flexible and efficient code for using collection classes without tying applications to specific implementations. Furthermore, enumerators provide a uniform interface to collection classes that can be extended to meet a wide range of needs including alternative traversal orders and algorithms.

Enumerators rely on the Anonymous Type pattern and make Heterogeneous Containers more powerful. Objective-C 2.0, available with Mac OS 10.5, Leopard, adds language features to further enhance Enumerators by reducing the amount of repetitive code needed to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required