Responders
When keyboard events, mouse events, timer events, or other events are detected by the run loop and the NSApplication instance that manages the run loop, those events are converted into instances of the NSEvent class and dispatched to other objects using Objective-C messages. The use of messaging is an important difference from other user interface toolkits and results in much of the power and flexibility of Cocoa. The Application Kit does not use C-language switch statements or explicit tables of function pointers. The messaging capabilities built into the Objective-C runtime are ideally suited to event dispatching.
An object that can receive event messages is called a responder. Figure 8.1 illustrates the relationships and communications ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access