我想创建一个短信页面,并希望在页面加载时看到键盘。这就是我所拥有的,这是行不通的。你能找到我做错了什么吗?
在我的头文件中:
@interface taskViewController : ViewController
@property (nonatomic, retain) IBOutlet UITextField *taskDescription;
- (void) viewWillAppear:(BOOL)animated;
@end
在我的 .m 文件中:
#import "taskViewController.h"
@interface taskViewController ()
@end
@implementation taskViewController
@synthesize taskDescription = _taskDescription;
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[_taskDescription becomeFirstResponder];
}
@end