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

Now that we have created a user interface, we need to create the events so that we can update this label to show how many taps have occurred. If you need to refresh your memory on how to go about this, you can refer to the section Making our components work together which we covered in Chapter 3, Working with the Interface Builder:

  1. Open the TapExampleViewController.h interface file located within the Classes folder of your project and add the following code:
    #import <UIKit/UIKit.h>
    @interface TapExampleViewController : UIViewController {
    UILabel *tapCountLabel;
    }
    @property (nonatomic, retain) IBOutlet UILabel *tapCountLabel;
    }
    @end
    
  2. We now need to open our TapExampleViewController.m implementation file, located ...

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