Preferences Tables

Preferences tables provide an aesthetically rich interface for displaying and changing program settings. These tables can be seen in the iPhone's Settings application, but most third-party applications provide a settings interface of their own to avoid making changes to the preloaded environment. Preferences tables provide resizable cells capable of hosting controls, text boxes, and informational text. They also provide a mechanism for logically grouping similar preferences together.

Creating a Preferences Table

Some forethought must be put into implementing a UIPreferencesTable class, as a callback-oriented data binding is used to query for the information used to fill the table. This is done in a similar fashion to the UITable objects you learned about in Chapter 3, but with a higher level of complexity. The runtime class invokes a set of methods in the data source to return information about the preferences table—the number and size of each cell, objects within cells, and information about logical groupings. Much to the discouragement of iPhone's open source community, this is very different from an object-oriented model where each cell would have its own properties and simply be added as objects. Instead, the construction for the entire preferences table is bulky and complex in spite of Apple's traditionally elegant design style.

Just to recap, the preferences table refers to the complete settings page. A table can have many logical groupings of like settings. ...

Get iPhone Open Application Development 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.