Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Create the User Interface Using Interface Builder 3

In the next phase of your project you’ll see how seamlessly Interface Builder and Xcode work together, enabling you to construct and implement the various elements in your project more efficiently and with less overhead.

  1. Open Interface Builder 3 (Figure 2-4) and drag the MainMenu.nib file in your Xcode project window on the Interface Builder 3 icon. Because of the new integration between Xcode 3 and Interface Builder 3, you’ll find the actions and outlets you’ve declared in your MyRecorderController.h file are also synchronously updated in Interface Builder 3. This will become apparent once you open your nib file and begin to work with the library of controls available in Interface Builder 3.


    Figure 2-4  The new Interface Builder 3 icon

    The new Interface Builder 3 icon
  2. In Interface Builder 3, you’ll find a new library of controls. Scroll down until you find the QuickTime Capture View control, as shown in Figure 2-5.


    Figure 2-5  QuickTime Capture View control in the library

    QuickTime Capture View control in the library

    The QTCaptureView object provides you with an instance of a view subclass to display a preview of the video output that is captured by a capture session.

  3. Drag the QTCaptureView object into your window and resize the object to fit the window, allowing room for the two Start and Stop buttons in your QTKit capture player.

  4. Choose Tools > Inspector. In the Identity Inspector, select the information (“i”) icon. Click in the field Class and your QTCaptureView object appears, as shown in Figure 2-6.


    Figure 2-6  The resized QTCaptureView object and its class Identity defined in the Identity Inspector

    The resized QTCaptureView object and its class Identity defined in the Identity inspector
  5. Set the autosizing for the object in the Capture View Size Inspector, as shown in Figure 2-7.


    Figure 2-7  Setting the autosizing for your QTCaptureView object

    Setting the autosizing for your QTCaptureView object
  6. Define the attributes of your MyRecorder Window, as shown in Figure 2-8.


    Figure 2-8  Window attributes defined in the Inspector

    Window attributes defined in the Inspector
  7. In the Library, select the Push Button control and drag it to the Window, as shown in Figure 2-9. Enter the text Start and duplicate the button to create another button as Stop. In autosizing, set the struts for both buttons at the bottom and right outside corners, leaving the inside struts untouched.


    Figure 2-9  Specifying Start and Stop push buttons

    Specifying Start and Stop push buttons
  8. Set up the autosizing for your buttons by selecting the button and clicking the Button Size Inspector shown in Figure 2-10.


    Figure 2-10  Setting up the autosizing for the Start and Stop buttons

    Setting up the autosizing for the Start and Stop buttons
  9. In the Library, scroll down and select the blue cube control shown in Figure 2-11, which is an object (NSObject) you can instantiate as your controller.


    Figure 2-11  The blue cube object for your controller

    The blue cube object for your controller
  10. Drag the object into your MainMenu.nib window, as shown in Figure 2-12.


    Figure 2-12  The object from the instantiated as a controller

    The object from the instantiated as a controller
  11. Select the object and enter its name as My Recorder Controller. Then click the information icon in the Inspector. When you click the Class Identity field, the MyRecorderController object appears. Interface Builder has automatically updated the MyRecorderController class specified in your Xcode implementation file. You don’t need to enter the name of this class in the Class Identity field. Note that to verify and reconfirm that an update has occurred, press Return. If the identify field is not automatically updated, you may need to specify manually that it is a MyRecorderController object.



< Previous PageNext Page > Hide TOC


Last updated: 2007-10-31




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice