I have a stopclock app and would like for the startCountButton
button to be disabled when it is initially pressed and then once the stopCountButton
button is pressed for it to be enabled again so that the start button can only be pressed once. Here is my code
- (IBAction)startCount:(UIButton*)sender {
countInt = 0;
self.label.text = [NSString stringWithFormat:@"%i", countInt];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countTimer) userInfo:nil repeats:YES];
}
- (IBAction)stopCount:(UIButton*)sender {
countInt = 0;
[timer invalidate];
}
-(void)countTimer {
countInt += 1;
self.label.text = [NSString stringWithFormat:@"%i", countInt];
}
Any help on what I would need to add? I am not looking to change text, just disabling it