O'Reilly logo

iPhone® Application Development For Dummies®, 4th 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

Chapter 12

The Trip Model

In This Chapter

arrow Recognizing the importance of models

arrow Working with property lists

arrow Starting the Trip class implementation

arrow Displaying variable content in the debugger

It’s time to add some content to RoadTrip. As I explain in Chapter 4, the owner of the data in the MVC design pattern 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 model interface. 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 Trip interface.

What’s in the Model

As I explain in Chapter 4, in the Model-View-Controller (MVC) design pattern that is the basis for all iPhone apps, the model owns the application logic and data. Therefore, to design your model, the best place to start, is with the application design presented 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 ...

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