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 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.