How do Responder Chain Works in IPhone? What are the “next responders”?

From the docs for the nextResponder: The UIResponder class does not store or set the next responder automatically, instead returning nil by default. Subclasses must override this method to set the next responder. UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t); UIViewController implements the method by returning its view’s superview; UIWindow returns the application object, and UIApplication returns nil.

The First Responder is a very specific concept in Cocoa. The only time iOS decides to set the First Responder is when a text field gets focus. At all other times you must explicitly control which object you want to be the first responder (see -canBecomeFirstResponder, -becomeFirstResponder).

There is no such thing as a second responder. All responders have a NextResponder, (which can be nil). This means that starting from any responder there may be (but may not be) an arbitrarily length chain of responders (responder -> nextResponder -> nextResponder -> etc) along which events are passed until they are handled.

There is a default chain which can be view -> superview -> superview but might also include UIViewControllers, UIWindows, UIWindowControllers, UIApplication and more, so it heavily depends on your object hierarchy (not just your view hierarchy - so no, you can't say nextResponder is always the parent view). On OSX 10.6 the default chain is even different for different types of events and actions and can even include your app delegate, which may or may not be a responder, i'm not sure if this is the case in iOS tho. The default chain is only the default tho, so after you have managed the First Responder it is down to you to insert, remove and append items to it's responder chain to achieve your desired aim.

The responder chain is quite important and complicated, you should take time to read the Apple docs about it.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions