O'Reilly logo

Cocoa Programming for Mac OS X, Third Edition by Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 24. NSTimer

An instance of NSButton has a target and an action (selector). When the button is clicked, the action message is sent to the target. Timers work in a similar way. A timer is an object that has a target, a selector, and a delay, which is given in seconds (Figure 24.1).

NSTimer

Figure 24.1. NSTimer

After the delay, the selector message is sent to the target. The timer sends itself as an argument to the message. The timer can also be set to send the message repeatedly.

To play with timers a bit, you will create a typing-tutor application. The application will have two BigLetterView objects. One will display what the user should type, and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required