More Modal View Controllers

In this part of the chapter, you will update Homepwner to present the DetailViewController modally when the user creates a new BNRItem. When the user selects an existing BNRItem, the DetailViewController will be pushed onto the UINavigationController’s stack as before.

Figure 13.4  New item

New item

To implement this dual usage of DetailViewController, you will give it a new designated initializer, initForNewItem:. This initializer will check whether the instance is being used to create a new BNRItem or to show an existing one. Then it will configure the interface accordingly.

In DetailViewController.h, declare this initializer. ...

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.