Graphics Reference
In-Depth Information
FIGURE 13-9
The Completed View in Interface Builder
In the header for the controller, we add
IBOutlet
references for the
UIImageView
and for
the
UIButton
. We use properties to make it clear that both of these are assignments and
do not need to be released. The header is shown in Listing 13-15.
LISTING 13-15
MainViewController.m Header
@interface
MainViewController : UIViewController
{
UIImageView
*
animImageView
;
UIButton
*
button
;
}
@property
(
assign
)
IBOutlet
UIImageView *animImageView;
@property
(
assign
)
IBOutlet
UIButton *button;
- (
IBAction
)action:(
id
)sender;
@end
In addition to the
IBOutlet
references, we have added a
-action:
method call to
IBAction
, which is called when the user presses the button on the view.