Chapter 7. Working with UITableViewCells

In This Chapter

Customizing a UITableView's appearance
Exploring options for laying out UITableViewCells
Optimizing UITableView performance by using a reuse identifier with cells
Exploring UITableViewCell inheritance

In the last chapter, you looked at how you could add a UITableView to your application to display a list of data. The way that you used the UITableView was pretty basic. You didn't do anything fancy in terms of customizing how it looks or anything like that. Naturally, it is possible to add quite a bit of customization to UITableViews, and in particular, the cells that make up the individual rows in the table view. And, it is possible to add quite a bit of customization to UITableView. Most of that customization applies to the appearance and behavior of the cells that make up the rows in the UITableView. You do this by customizing the UITableViewCell objects that you return from the UITableViewDataSource when displaying the data. This is an incredibly powerful method for customizing your UITableView and will be the focus of this chapter.

You'll begin exploring the UITableViewCell class by looking at the parts that make up a UITableViewCell and how you can use those parts to provide a custom appearance. You will then see how you can use inheritance to create a custom UITableViewCell that enables you to do virtually anything that you want to.

Understanding the Parts of a UITableViewCell

Before you begin customizing a UITableViewCell, you ...

Get Cocoa Touch™ for iPhone® OS 3 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.