Reputation: 492
I've a form with five NSTextFields. After the user clicks the "Add" button I would like that the selection goes to the first text field so the user can start typing info again.
Is there a way to do that? Closing an reopening the view doesn't work for this.
Upvotes: 1
Views: 72
Reputation: 25697
Make the text field that you want the focus to shift to the 'first responder'. You tell the window to do this:
[[textFieldToEdit window] makeFirstResponder:textFieldToEdit];
Upvotes: 2