April 2015
Intermediate to advanced
556 pages
17h 47m
English
As you learned in Chapter 5, controls have a target and an action. The target is a reference to another object; the action is a selector (essentially the name of the method to be called on the target). When a button is clicked, the action method is called on the target.
Timers work in a similar way. A timer is an object that has a target, a selector, and an interval, which is given in seconds (Figure 23.1). After the interval has elapsed, the action is called on the target. The sender in this case is the timer itself. The timer can also be set to send the message repeatedly.
Figure 23.1 NSTimer
To play with ...
Read now
Unlock full access