O'Reilly logo

iPad Application Development For Dummies, 3rd Edition by Neal Goldstein

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

Setting Up the Map Controller

In this section, you need to do the same things you do in Chapter 16 to create and connect the MapController object to the storyboard. Here you go again!

Adding the custom view controller

To add the MapController to the RoadTrip project, follow these steps:

1. In the Project navigator, select the View Controller Classes group and then either right-click the selection and choose New File from the menu that appears or choose FileNewNew File from the main menu (or press maccmd +N).

Whatever method you choose, you’re greeted by the New File dialog.

2. In the left column of the dialog, select Cocoa Touch under the iOS heading, select the Objective-C class template in the top-right pane, and then click Next.

You’ll see a dialog that will enable you to choose the options for your file.

3. Enter MapController in the Class field, choose or enter RTDetail ViewController in the Subclass Of field, make sure that the Target for iPad check box is selected and that With XIB User Interface is deselected, and then click Next.

4. In the Save sheet that appears, click Create.

5. Delete the shouldAutorotateToInterfaceOrientation: method.

You’ll use the default in the RTDetailViewController.

Setting Up the MapController in the MainStoryboard

Now that you have a custom view controller, you need to tell the storyboard to load your custom view controller rather than a ...

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