- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[self checkRun:nil];
return YES;
}
我正在尝试IBAction
checkRun
通过使用上面的代码来完成按下回车键时的,但似乎无法正常工作。我要去哪里错了?我以为可能是因为我没有直接引用我输入的文本字段,但是我无法确定需要在何处放置该文本字段的名称。
提前致谢。
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;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句