Configuring the SubscribeController View

Use Interface Builder to configure the SubscribeController.xib file and create the user interface. Although the provided XIB file is already configured, you can walk through the steps to see how to create the interface.

  1. Click the SubscribeController.xib file to reveal a view of the (presently empty) screen in the right pane and the following three items represented by icons in the middle pane:
    • File's Owner – the object that is set to be the owner of the user interface, which is typically the object that loads the interface. In this tutorial, this is the SubscribeController.


      File's Owner icon

    • First Responder – the first responder proxy object handles events. Connecting an action to the first responder means that when the action is invoked, it is dynamically sent to the responder chain.


      First Responder icon

    • View – displayed in a separate window to allow you to edit it.


      View icon

  2. Select the File's Owner icon, click View in the utility area, click Show the Identity Inspector, and make sure SubscribeController appears in the Class field under Custom Class.

    Custom Class - Class field with SubscribeController
    This tells Interface Builder the class of the object to allow you to make connections to and from the File's Owner.
  3. Click the View icon, and in the Identity Inspector panel, and make sure UIView appears in the Class field under Custom Class.

    Custom Class - Class field with UIView
  4. To create a Subscribe button, select View > Utilities > Show Object Library.
    1. In the Object Library panel, select the Round Rect Button item, drag it onto the view.

      Object Library panel - Round Rect Button item
    2. Double-click it and enter Subscribe and press Return.
  5. In the Accessibility section of the Identity Inspector, make sure Enabled is unselected.
    Disable the button because the application cannot subscribe to the server for updates until it is connected.
    Accessibility options
  6. Control-click the Subscribe button to show the inspector.
  7. Drag from the circle to the right of Touch Up Inside to the File's Owner icon and release, then click on buttonPressed to establish a connection between the Subscribe button and the button's action method:

    Subscribe button options