Instance Method


Registers a given timer with a given input mode.


- (void)addTimer:(NSTimer *)timer forMode:(NSRunLoopMode)mode;



The timer to register with the receiver.


The mode in which to add aTimer. You may specify a custom mode or use one of the modes listed in Run Loop Modes.


You can add a timer to multiple input modes. While running in the designated mode, the receiver causes the timer to fire on or after its scheduled fire date. Upon firing, the timer invokes its associated handler routine, which is a selector on a designated object.

The receiver retains aTimer. To remove a timer from all run loop modes on which it is installed, send an invalidate message to the timer.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software