CHAPTER 8 EXERCISE SOLUTIONS

Answer to Question 1

The two protocols are UITableViewDataSource and UITableViewDelegate.

The UITableViewDataSource protocol contains events that you can implement to populate the Table view with the various items.

The UITableViewDelegate protocol contains events that you can implement to handle the selection of rows in a Table view.

Answer to Question 2

To add an index list to your Table view, you need to implement the sectionIndexTitlesForTableView: method.

Answer to Question 3

The three disclosure and checkmark accessories are as follows:

  • UITableViewCellAccessoryDetailDisclosureButton
  • UITableViewCellAccessoryCheckmark
  • UITableViewCellAccessoryDisclosureIndicator

The UITableViewCellAccessoryDetailDisclosureButton image handles a user's tap event. The event name is tableView:accessoryButtonTappedForRowWithIndexPath:.

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.