Outline Views visualize a tree of hierarchical data.
is actually a subclass of
NSTableView, so much of its
functionality should be familiar from the previous
chapter. Individual objects are still displayed in separate rows, and each
column still represents a property of that object.
Superficially, the only real difference is the disclosure triangles that expand or collapse a particular node. However, the underlying data set is quite different. Instead of a flat array of objects, Outline Views let the user drill down into a hierarchy of objects. This can be any kind of parent-child relationship: organizational structures, family trees, file systems, and XML documents are just a handful of examples.
This chapter provides a brief walkthrough of the
class. We’ll build up the necessary data set from scratch, implement a
data source and delegate, expand and collapse rows programmatically, and
manipulate the current selection.
Sorry, this is the end of the preview. To read the rest of this chapter, you’ll need to purchase Ry’s Cocoa Tutorial.
Sign up for my low-volume mailing list to find out when new content is released. Next up is a comprehensive Swift tutorial planned for late January.
You’ll only receive emails when new tutorials are released, and your contact information will never be shared with third parties. Click here to unsubscribe.