I would like to understand the process of the declaration of a button.
@interface MerdaViewController : UIViewController{
IBOutlet UIButton *button;
}
@property (retain, nonatomic) IBOutlet UIButton *button;
@end
Why do we need those steps?
Is it always required?
Thank you so much.
Alex.
To create a button outlet you just need this line.
To create button action
Just like to add another point:
Outlets should generally be weak/assign, except for those from File’s Owner to top-level objects in a nib file (or, in iOS, a storyboard scene) which should be strong/retain