- The default implementation of
becomeFirstResponder makes a call to canBecomeFirstResponder . This is because the responder that returns NO from canBecomeFirstResponder does not have to be the first responder. becomeFirstResponder will make the receiver actually the first responder if it succeeds. canBecomeFirstResponder just checks to see if the receiver wants to be the first responder without changing anything. It is possible that becomeFirstResponder could fail if the current first responder refuses to resign. There may be other situations in which becomeFirstResponder may also fail.- There should not be anything in your code that has the first status of the responder. Judging by the private method UIResponder
firstResponder , in this case, the system does not assign any specific value.
Basically, when someone wants to become the first responder, the current first responder (if any) will be asked to resign, and then the new facility will become the first responder. This may cause the system to display an on-screen keyboard or take some other action. When the first responder resigns, this may cause the system to hide the on-screen keyboard or take some other action.
When an event without a touch arrives, it is first delivered to UIWindow. UIWindow delivers it to the first responder. The documentation does not seem to indicate whether UIWindow is trying to process the event itself (and pass it to UIApplication, as usual if it does not handle it) or simply ignore the event if there is no first responder.
See the documentation for more details.
Anomie
source share