10
UITableView and UITableViewController

Many iOS applications show the user a list of items and allow the user to select, delete, or reorder items on the list. Whether an application displays a list of people in the user’s address book or a list of best-selling items on the App Store, it is a UITableView doing the work.

A UITableView displays a single column of data with a variable number of rows. Figure 10.1 shows some examples of UITableView.

Figure 10.1  Examples of UITableView

Collage of two screenshots from an iPhone, the Contacts app and Photos and Camera Settings showing the UI Table View outlook.

Beginning the Homepwner Application

In this chapter, you are going to start an application called Homepwner that keeps an inventory of all your possessions. In the case of a fire or other catastrophe, you will have a record for your insurance company. (Homepwner, by the way, is not a typo. If you need a definition for the word pwn, visit www.wiktionary.org.)

So far, your iOS projects have been small, but Homepwner will grow into a realistically complex application over the course of eight chapters. By the end of this chapter, Homepwner will present a list of Item instances in a UITableView, as shown in Figure 10.2.

Figure 10.2  Homepwner: phase 1

Screenshot shows the preferred final output of the “Homepwner” app. The output displays a list comprised of five different names of which are values in US dollars.

To get started, open Xcode and create a new iOS Single View Application project. Configure it as shown in Figure 10.3.

Figure 10.3  Configuring Homepwner

Screenshot displays the configuration settings for Homepwner app.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset