Datasheet
754
Adding Some Code to Actually Add Some Functionality
Figure 1-12:
Connecting
the button
to the action
method.
Adding Some Code to Actually
Add Some Functionality
Making all the necessary connections Interface Builder, as spelled out in
the last section, ensures that your code will compile and run (and give you
a few choice warnings about unimplemented methods in the bargain), but
RoadTrip really won’t do anything different now as opposed to what it could
do at the start of this chapter. What you have done, however, is gotten your-
self ready to add the code to enable you to enter the hotel information.
If you’re like me, you’re probably impatient to actually see something
work, so first add the initWithHotel:trip: method in Listing 1-2 to
AddHotelController.m.
Listing 1-2: InitWithHotel:trip
#import “AddHotelController.h”
#import “Hotel.h”
#import “Trip.h”
@implementation AddHotelController
41_542934-bk07ch01.indd 75441_542934-bk07ch01.indd 754 3/23/10 11:01 PM3/23/10 11:01 PM