Created
January 4, 2013 18:22
-
-
Save rd13/4454720 to your computer and use it in GitHub Desktop.
Simple Objective-C Timer Example
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
//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