Modal View Controllers

In this part of the exercise, you will update Homepwner to present the ItemDetailViewController modally – but only when the user creates a new Possession. When the user selects an existing Possession, the ItemDetailViewController will be pushed onto the UINavigationController’s stack as before.

Figure 14.5  New item

New item

To implement this dual usage of ItemDetailViewController, you will give it a new designated initializer, initForNewItem:isNew:. This initializer will check whether the instance is being used for creating a new Possession or for showing an existing one and then configure the interface accordingly.

In ItemDetailViewController.h ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition 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.