我有一个标签 00:00.0 和按钮。当我按下按钮时,无论我点击多少次,计时器都应该在标签上计数。当我点击标签时计时器应该停止,并且应该在第二次点击同一标签时重置。
我尝试了一切,但我无法达到结果:) 任何人请帮助我。
@interface MainViewController : UIViewController <FlipsideViewControllerDelegate> {
IBOutlet UILabel *stopWatchLabel;
NSTimer *stopWatchTimer; // Store the timer that fires after a certain time
NSDate *startDate; // Stores the date of the click on the start button
}
@property (nonatomic, retain) IBOutlet UILabel *stopWatchLabel;
- (IBAction)onStartPressed:(id)sender;
- (IBAction)onStopPressed:(id)sender;
- (void)updateTimer;