O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the DetailController Singleton

In addition to implementing the split view controller delegate protocol, the new class eventually manages the detail content. And even if it did not, most of the changes made by a split view delegate are to the detail view.

First, you implement the singleton functionality:

1. Add a new class called DetailController, based on NSObject, to the bottom of the iPad group.

2. Open DetailController.h and add the following line just above the @end statement. The + sign indicates a class method:

+ (DetailController*)sharedDetailController;

3. Set the contents of DetailController.m to the code shown in Listing 11-3.

Listing 11-3 Detail Controller Implementation

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required