Step 2: Updating CarTableViewController

The changes to CarTableViewController are quite small: removing the protocol, making the existing protocol methods public, and setting the ViewCarTableViewController block properties.

To save time, each of the blocks is a call to the original protocol method. If you were starting the design from scratch, you would do the work in the blocks instead of calling methods. Here’s what you do:

1. Open CarTableViewController.h and remove all references to ViewCarProtocol.

2. Add public declarations for each of the old protocol implementation methods:

- (CDCar *)carToView; - (void)carViewDone:(BOOL)dataChanged; - (void)nextOrPreviousCar:(BOOL)isNext;

At the moment, MainMenuViewController ...

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.