R – Trying to understand the First Responder object in nibs

cocoafirst-respondernibobjective c

Let me summarize this shortly: A "First Responder" in a nib file is an object, which represents the UI control element that has the user's focus. So if the user clicks on a control, the nib sets that clicked UI control as First Responder. In my app I could make an outlet to that "First Responder" from the nib, so that I could for example send a message "make red font color" to whatever the user has activated by clicking.

And then, if this First Responder UI control does not understand that message, the message gets passed up in the responder chain, until a parent element or grandparent (and so on) UI control element understands the message. Otherwise it will be ignored.

So First Responder always establishes a "link" to the UI control that has focus. Is that right?

(Exact duplicate of "First Responder" – Did I get that right? by the same author)

Best Answer

The first responder is simply the object that will be told (and given a chance to respond) to an event (such as a mouse click) in your application.

Related Topic