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 O’Reilly online learning.

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