Tuesday, 4 June 2013

How to call a function using NSTimer: Xcode

NSTimer can be used to call functions with a scheduled delay. You can control the interval and repeat mode (whether the function need to be called per every delay intervals or not) also. The syntax is very simple, and is given below:

Syntax:

         [NSTimer scheduledTimerWithTimeInterval:0.60
                                                                   target:self
                                                                   selector:@selector(myFunction)
                                                                   userInfo:nil
                                                                   repeats:NO];

No comments:

Post a Comment