- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[self checkRun:nil];
return YES;
}
I'm trying to complete the IBAction
checkRun
when the return key is pressed, by using the above code, but it doesn't seem to be working. Where am I going wrong? I thought maybe it's because I'm not directly referencing the textfield that I'm typing in, but I can't work out where I'd need to put the name of that textfield.
Thanks in advance.
Tap “123” key in the bottom-left corner of the keyboard. 2. The Return key is located in the bottom-right corner, next to the space bar.
key on the lower-right corner of the numeric keypad. And you can find the return key on the right side of the main alphanumeric portion of the keyboard. While on the ANSI keyboard, you can find the return key on the third row, above the right-hand Shift key and below the backslash \ key.
On a Mac, you'll see a Return key in the main alphanumeric section of the keyboard and an Enter key in the numeric keypad section of extended keyboards. This arrangement first appeared on the Apple Lisa keyboard in 1983 and carried over to the Mac Numeric Keypad in 1984 and the Mac Plus extended keyboard in 1986.
The Enter key was originally the "Return key" on a typewriter, which caused the carriage to return to the beginning of the next line on the paper. In a word processing or text editing application, pressing Enter ends a paragraph.
ViewController.h:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UITextFieldDelegate>
@end
ViewController.m:
#import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) UITextField *textField;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.textField.delegate = self;
}
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