Adding Editor Behaviors

You need a reference to each field so you can populate and read the text. As before, you add the behaviors in two steps: First, you add the outlets and actions, and then you implement the behaviors. You use Table 3-3 for setting the outlets and actions. As before, you want to open the storyboard with the Assistant editor showing CarEditViewController.h.

Image

Table 3-3 CarEditViewController.h Outlets

To set values for the Car Number label and the text fields, you need a reference to the car object being edited as well as the car number. The add/view scene needs to communicate data to the edit scene. The first approach is to ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.