O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

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

Capturing media with the camera

In this recipe, we will learn how to use the iOS device camera for capturing media.

Getting ready

Following on from our previous recipe, create a new Single View Application, and name it CameraPickerExample.

How to do it...

To begin, follow these simple steps as outlined in the following order:

  1. Select the ViewController.xib files from the Project Navigator window.
  2. From the Object Library, select and drag a UIToolbar object, and add this to our view and click on the Item button located within our toolbar.
  3. From the Attributes Inspector section, change the Identifier property to Camera.
  4. Create an outlet for this UIBarButtonItem, and name it btnCamera.
  5. Create the action method for the Camera button and name it btnCamera.

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