Configuring the SettingsViewController View

Use Interface Builder to configure the SettingsViewController.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 SettingsViewController.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 SettingsViewController.


      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 – appears in a separate window to allow editing.


      View icon

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

    Custom class iOS.png
    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 add a Table view, select View > Utilities > Show Object Library.
    Table_Option
  5. In the Object Library pane, select the Table View item, and drag it onto the view.

    Table_View
  6. To make connections to the user interface from the view controller, the SettingsViewController.h file contains the outlets.
    @ interface SettingsViewController : UIViewController
                   {   
                      IBOutlet UITableView *m_settingsTableview;
                   }
    
  7. Go to SettingsViewController.xib, select and right-click the File Owner. In Outlets, m_settingsTableview appears.
    mSettings table view drag
  8. Drag from the m_settingsTableview circle to view and release. The connection to the File Owner has been made. A pop-up with datasource and delegate appears in the table view.
    mSettings table view
  9. Select the Table View, go to IBInterfaceBuilder, select Style to Grouped.
    Table view grouped
  10. Set the background color of the view to Clear Color.
    Clear color
  11. In Referencing Outlets -> New Referencing Outlet, drag from the right circle to table view and release. A pop-up with datasource and delegate appears in the view. Select datasource to establish a connection between table view and table view datasource methods.
  12. In Referencing Outlets -> New Referencing Outlet, drag from the right circle to table view and release. A pop-up with datasource and delegate appears in the view. Select delegate to establish a connection between table view and table view callback methods.