Adding Rows

There are two common interfaces for adding rows to a table view at runtime.

  • A button above the cells of the table view. This is usually for adding a record for which there is a detail view. For example, in the Contacts app, you tap a button when you meet a new person and want to take down all their information.

  • A cell with a green plus sign. This is usually for adding a new field to a record, such as when you want to add a birthday to a person’s record in the Contacts app. In edit mode, you tap the green plus sign next to add birthday.

In this exercise, you are using the New button in the header view instead. When this button is tapped, a new row will be added to the UITableView.

In BNRItemsViewController.m ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.