I have 3 textfields (Username, Password, Confirm Password). When the form loads I wish for the cursor to start off in the textfield Username when the form is first displayed. Please give me some advice. Thank in advance.
[usernameTextField becomeFirstResponder];
This should provide you with the desired result. You can read about the responder chain here if you want to understand more about the mechanism.
Edit:
My bad, I thought you meant UITextField (Cocoa Touch).
Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly.
[window makeFirstResponder:usernameTextField];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With