Configuring the SubscribeController View
- Get link
- Other Apps
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.
- 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.
- 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.
- View – appears in a separate window to allow editing.
- 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.
- 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.
This tells Interface Builder the class of the object to allow you to make connections to and from the File's Owner. - Click the View icon, and in the Identity
Inspector panel, and make sure UIView
appears in the Class field under Custom Class.
- To create a Subscribe button, select View > Utilities > Show Object Library.
- In the Object Library pane, select the Round Rect
Button item, and drag it onto the view.
- Double-click it, enter Subscribe, and press Enter.
- In the Object Library pane, select the Round Rect
Button item, and drag it onto the view.
- To make connections to the user interface from the view controller, the
SubscribeController.h file contains the outlets, property declarations for the
instance variables, and a declaration for the action method.
-(IBAction)buttonPressed:(id)sender; @property (nonatomic, retain) IBOutlet UIButton *button; @property (nonatomic, retain) MenuListController *menuController;
- In the Accessibility section of the Identity Inspector, unselect Enabled.The application cannot subscribe to the server for updates until it is connected.
- Ctrl-click the Subscribe button to show the inspector.
- Drag from the circle to the right of Touch Up
Inside to the File's
Owner icon and release, then click buttonPressed to establish a connection between the Subscribe
button and the button's action method:
- Get link
- Other Apps
Comments
Post a Comment