Attempts to make a given responder the first responder for the window.
- macOS 10.0+
The responder to set as the window’s first responder.
nilmakes the window its first responder.
YES when the operation is successful; otherwise,
responder isn’t already the first responder, this method first sends a
resign message to the object that is the first responder. If that object refuses to resign, it remains the first responder, and this method immediately returns
NO. If the current first responder resigns, this method sends a
become message to
responder does not accept first responder status, the
NSWindow object becomes first responder; in this case, the method returns
YES even if
responder refuses first responder status.
nil, this method still sends
resign to the current first responder. If the current first responder refuses to resign, it remains the first responder and this method immediately returns
NO. If the current first responder returns
resign, the window is made its own first responder and this method returns
The Application Kit framework uses this method to alter the first responder in response to mouse-down events; you can also use it to explicitly set the first responder from within your program. The
responder object is typically an
NSView object in the window’s view hierarchy. If this method is called explicitly, first send
responder, and do not call
initial to the set the first responder to be used when the window is brought onscreen for the first time.