Creating MainMenuViewController

Creating a custom class for a table using static cells is much easier than creating one using dynamic cells. The system handles all the methods to determine number of sections, determine number of rows, and create cells. All you need is tableView:didSelectRowAtIndexPath: for acting on user selections. Add the functionality for the main menu by following these steps:

1. With the iPad folder selected, create a subclass of UITableViewController called MainMenuViewController.

2. In the .m file, replace the contents with the following:

#import "MainMenuViewController.h" #import "AppDelegate.h" @implementation MainMenuViewController - (void)viewDidLoad {     [super viewDidLoad]; }

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.