Chapter    6

Using Table Views

Chapters 4 and 5 covered some of Cocoa’s most common GUI components, from buttons and simple input fields to full-fledged text editors. We haven’t yet talked about one of Cocoa’s biggest, most complex view classes, NSTableView. This chapter will cover how to use an NSTableView to display data for whole collection of components, how to respond when the user changes the table’s selection by clicking a row, and how to edit values right in the table.

We’ll learn how to use a table view by extending the VillainTracker application from Chapter 5. The new version of VillainTracker we create in this chapter will maintain an array of villains, display them all in a table, and let the user edit all the attributes of the ...

Get Learn Cocoa on the Mac, Second Edition 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.