The Trip Model
In This Chapter
Recognizing the importance of models
Working with property lists
Trip class implementation
Displaying variable content in the debugger
It’s time to add some content to RoadTrip. The owner of RoadTrip’s data is the model, so I start this chapter with a look at the data you’ll need and how the model will manage it. Then I show you how to add a
Trip class that will serve as the interface to the model. Finally, you see how to add the
Destination class — which is one of the objects that will be used by the model but is hidden behind the
What the Model Contains
In the Model-View-Controller (MVC) design pattern that is the basis for all iOS apps, the model owns the app content logic and data. Therefore, to design your model, the best place to start is with the app design I present in Chapter 4 and consider what will be displayed in the views.
In this first version of RoadTrip, the model needs to provide, for each destination, the following:
- The destination name
- A background image for the destination
- The destination ...