Is there anyway to write code instead of setting a selector to method to call in NSTimer? If i want to print hello world after 5 sec i can do it like this.
[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(helloWorld:) userInfo:nil repeats:NO];
and have this function
-(void)helloWorld:(NSTimer*)aTimer {
NSLog(@"Hello World!");
}
But instead of writeing functions for every timer you have is it possible to add NSLog(@"Hello World!") in the same line as where i create the timer?