Created
May 24, 2012 03:10
-
-
Save donly/2779217 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declcare | |
@property (assign) NSTimer *repeatingTimer; | |
// implements | |
- (IBAction)startRepeatingTimer:sender { | |
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5 | |
target:self selector:@selector(timerFireMethod:) | |
userInfo:[self userInfo] repeats:YES]; | |
self.repeatingTimer = timer; | |
} | |
- (IBAction)stopRepeatingTimer:sender { | |
[repeatingTimer invalidate]; | |
self.repeatingTimer = nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment