Chapter 13

Implementing the Content Controller

In This Chapter

arrow Working with custom view controllers

arrow Using the Trip model to get data for the view

With the model in place, you can now return to the Content view controller that you add in Chapter 11 and transform its view into the user interface you fell in love with in Chapter 4. In this chapter, you replace the “generic” UIViewController or UITableViewController supplied by the storyboard with a custom view controller. By doing so, you add the logic to connect the view to the model.

remember_4c.eps The way you are about to add the logic to connect the view to the model via the view controller in this chapter is the general formula you will use for the rest of the view controllers in the storyboard. Although you can add the view controllers to the storyboard graphically, as you have done, you need to add some code to have the controller actually do anything, such as get data from the model and send it to the view.

Using Custom View Controllers

The view controller provided by the storyboard is a UIViewController and is clueless about what you want to display in a view, much less the model it will need to get the data from. In this section, you create ...

Get iPhone® Application Development For Dummies®, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.