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.

Get Xcode 4 Cookbook now with O’Reilly online learning.

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