hi i have a simple UIButton named "button" with the IBAction "show" connected to it. I want it to be that when the user taps this button, nothing happens, but when the user taps it one more time, then the label magically appears. The user may tap the button once, and an hour later tap it again, and the label will only appear when the user taps the button "button" the second time. Here's the code:
h. file:
@interface PlayingCampeignViewController : UIViewController {
UILabel *label;
UIButton *button;
NSUInteger *number;
}
@property (nonatomic, retain) IBOutlet UILabel *label;
@property (nonatomic, retain) IBOutlet UIButton *button;
-(IBAction)show;
@end
m. file:
-(void)viewDidLoad {
number = 0;
}
-(IBAction)show {
number = number + 1;
if (number == 2) {
label.hidden = NO;
}
h. file:
@interface PlayingCampeignViewController : UIViewController {
UILabel *label;
UIButton *button;
NSUInteger *number;
}
@property (nonatomic, retain) IBOutlet UILabel *label;
@property (nonatomic, retain) IBOutlet UIButton *button;
-(IBAction)show;
@end
m. file:
-(void)viewDidLoad {
number = 0;
}
-(IBAction)show {
number = number + 1;
if (number == 2) {
label.hidden = NO;
}