The Weather Controller
Now that you have the
Trip object set up to deliver the data you need, the
WeatherController needs to pass on to the view to load the web page.
You need to add some
#import compiler directives so that
Weather Controller can access
RTAppDelegate to get the
Trip reference and request the data it needs.
To do that, add the bolded code in Listing 15-3 to
Listing 15-3: Updating the WeatherController Implementation
@interface WeatherController ()
The template provides a
viewDidLoad method stub when you create the controller file. You may recall from previous chapters that this is where you want to have the Web view (or any other view) load its data. Add the bolded code in Listing 15-4.
Listing 15-4: Adding to ViewDidLoad
self.title = @”Weather”;
self.weatherView.scalesPageToFit = YES;
RTAppDelegate *appDelegate =
[[UIApplication sharedApplication] delegate];
The first thing you do in Listing 15-4 is set the title to
The title won’t be showing up on the toolbar, however, since this just sets the title in the Navigation bar. I’ll use it when I add a Return To Whatever button in the “Managing links in a Web view” section, a bit later in the chapter. ...