USING THE TABLE VIEW IN A MASTER-DETAIL APPLICATION

In the previous sections, you created a Single View Application project, manually added a Table view to the View window, connected the data source, and delegated to the File's Owner item. You then handled all the relevant events defined in the two protocols — UITableViewDelegate and UITableViewDataSource, so that you could populate the Table view with items and make them selectable.

In real life, the Table view is often used with a Master-Detail (previously known as the Navigation-based Application) project because users often need to select an item from a Table view and then navigate to another window showing details about the item selected. For this reason, the Master-Detail Application template in the iOS SDK by default uses the UITableView class instead of the UIView class. This section demonstrates how to use a Table view from within a Master-Detail Application project.

Get Beginning iOS 5 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.