O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

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

Adding New Cars

You already have a method to add cars. All you need is a user interface item to call it. Look at an app with table views that allow the creation of data items, such as Contacts. Apps like these commonly have an Add button in the navigation bar. Here’s how you implement one in the CarValet app:

1. Open the storyboard and drag a bar button item into the navigation bar of the add/view scene.

2. Select the Attributes inspector for that button and change the identifier to Add. You see the button change to one with a + icon.

3. Ctrl-drag from the button to the car table view controller and choose newCar: under Sent Actions.

Run the app and tap the Add button. Nothing seems to happen. In fact, cars are added, but nothing is telling 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