Skip to content

Instantly share code, notes, and snippets.

@rd13
Created January 4, 2013 18:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rd13/4454720 to your computer and use it in GitHub Desktop.
Save rd13/4454720 to your computer and use it in GitHub Desktop.
Simple Objective-C Timer Example
//Do something 2 seconds after view loads
- (void)viewDidLoad
{
[super viewDidLoad];
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(theAction)
userInfo:nil
repeats:NO];
}
-(void) theAction {
NSLog(@"Will appear after a 2 second delay.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment