O'Reilly logo

Xcode 4 iOS Development by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – binding our Controls using Outlets and Actions

Our final step will be to bind our control objects to our View Controller and connect these via outlets and actions. We covered this in the section Making our Components work together in Chapter 3, Working with the Interface Builder:

  1. Once you have created your outlets within your FavoriteColorViewController.h interface file, it should look something like this. What we are doing here is basically letting our View Controller be aware of what controls we will be dealing with:
    #import <UIKit/UIKit.h>
    @interface FavoriteColorViewController : UIViewController {
    UITextField *txtColor;
    IBOutlet UILabel *lblColor;
    }
    @property (nonatomic, retain) IBOutlet UITextField *txtColor;
    @end
    
  2. Our next ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required