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.
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.
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.
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.
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.
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.
Set the autosizing for the object in the Capture View Size Inspector, as shown in Figure 2-7.
Define the attributes of your MyRecorder Window, as shown in Figure 2-8.
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.
Set up the autosizing for your buttons by selecting the button and clicking the Button Size Inspector shown in Figure 2-10.
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.
Drag the object into your MainMenu.nib window, as shown in Figure 2-12.
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.
Last updated: 2007-10-31