Responder Actions and Responder Chain

I am relatively new to IPhone coding, although I have come to the conclusion that I am working on a genuine (hopefully) useful product.

But one thing that is still mysterious is the chain of defendants. All books provide a link to it, but I have not yet found one that describes how to change this chain. Another curiosity is that when you click on the icon of the first responder in IB, the small connection box comes up with all kinds of options to connect to something, but I never found any explanation.

Does anyone know of an in-depth explanation of this response process?

+4
source share
2 answers

Here Jeff Lamarches explains the chain of defendants. Although this is not exhaustive, it should make you think about the right path.

+3
source

The responder chain is the order in which various objects are given the opportunity to handle the event. In the simple case, suppose we have a button in NSView in NSWindow in NSApp. At the push of a button; the button will have the first opportunity to handle the event, then its controller, then NSView, then its controller, then NSWindow, then its delegate, then NSApp and its delegate. Thus, the object is first given the opportunity to handle the event, then its controller / delegate, then the container of the object, etc. There are other cases that are much more complex .

The object processes the event, implementing the event (void) responseToFictionalEvent: (UIEvent *). If this happens, the event will be consumed (prevented from being automatically passed down the chain).

+2
source

All Articles