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 ...

Get Xcode 4 iOS Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.