Step 4: Updating MainMenuViewController

This class only uses the protocol for going to the next or previous car, so there are two simple updates:

1. In the .h file, remove the two uses of ViewCarProtocol.

2. In the .m file, tableView:didSelectRowAtIndexPath: has a small change. In the switch case for kPadMenuCarsItem, replace the line:

currentCarDetailController.delegate = carTable;

with this:

currentCarDetailController.nextOrPreviousCar = ^(BOOL isNext)                             {[carTable nextOrPreviousCar:isNext];};

This change uses blocks copying in scope variables to include carTable, a reference to the master cars table menu. Since carTable implements nextOrPreviousCar:, and ...

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.