Making Connections

Goal: Add a Navigation Controller to the MainWindow.xib and create a connection from the AppDelegate to the Navigation Controller .

  1. Double-click the the MainWindow.xib file.
  2. In the Interface Builder Tools > Library menu, drag and drop the Navigation Controller onto the MainWindow.xib documents window.
  3. Create a connection from the AppDelegate to the Navigation Controller.
    1. Control-click the AppDelegate icon to show available outlets and actions.
    2. In the MainWindow.xib, Control-drag from the AppDelegate icon to the new Navigation Controller icon and select the navController outlet.
    3. Select the Navigation Controller icon and change the View Mode to list view (click the middle icon).
    4. From the Navigation Controller list, select UIViewController and open the Identity Inspector in Tools > Identity Inspector.
    5. In the Identity Inspector, in Class, select SubscribeController.

      iphone_SubscribeController_class
      UIViewController changes to SubscribeController.
    6. Save the MainWindow.xib file.
  4. Establish a connection between the Subscribe button you added to the SubscribeController.xib and the button's action method.
    1. Open the SubscribeController.xib file.
    2. In the View window, control-click the Subscribe button to show the inspector, then drag from the open circle in the Touch Up Inside Events list to the File's Owner icon and select buttonPressed.
      This shows the way the button is connected to the buttonPressed 76 event.
      iphone_subscribe_button_connect
    3. Save the SubscribeController.xib file.