Car Detail Controller

You already have a controller to show car detail on the iPhone storyboard. Better still, it uses a protocol to find what car to show and let a delegate know if there are changes. Follow these steps to show car detail:

1. Open the iPhone storyboard and set the ViewCarTableViewController storyboard ID so it’s the same as the class name.

2. Open MainMenuViewController.m and import ViewCarTableViewController.h. Now add instance variables for a current car and current controller below @implementation:

{     CDCar *currentCar;     ViewCarTableViewController *currentViewCarController; }

3. Add support for ViewCarProtocol to MainMenuViewController and copy the protocol methods to the end of the implementation: ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming 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.