More Debugger Stuff
In this section, I give you something more interesting to look at in the Debugger than you’ve had up to now for this book’s example app. As it stands, you can compile RoadTrip with no errors and it runs, albeit the same way that it did before. So you have no idea if all that code you added really works. Does it really find the
Destinations.plist file and create all the dictionaries with their entries correctly?
One way to find out is to put a breakpoint in your code and see what’s there; so go ahead and set a breakpoint in
Trip.m on the following line by clicking in the gutter next to (in front of) the line:
destination = [[Destination alloc]
Then set another breakpoint in
Destination.m on the following line:
Run your application.
When you move your pointer over an object or variable in the Source editor, you can see its contents. In Figure 11-14, I’ve done that with
destination Data (and so should you).
destinationData is a pointer to the dictionary that contains the data for the first entry in the Destination plist’s
DestinationData array. There are six key/value pairs, as there should be, and if you look in the Variables pane in the Debugger, you’ll see two objects in the
destinationsArray, which is also as it should be.
If you move your pointer into the
destinationData variable display in the Source editor and Control-click in the up and down ...