Answer the question
In order to leave comments, you need to log in
Xcode TextField: How to make a method call on pressing the Enter key on the keyboard?
There is NSTextField and Button, they are connected by method. When the Button is clicked, a method is called that takes information from the NSTextField. How can I make the same method be called on pressing the Enter key on the keyboard, after entering text into the NSTextField?
Answer the question
In order to leave comments, you need to log in
Already figured it out myself. For NSTextField, we add an Action, in which we describe the method call described for a regular Push Button. In my case it looks like this
- (IBAction)enterButton:(id)sender {
[self pushButton:sender];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question