我有一个检查密码的视图控制器......这在程序启动时使用......以及更改旧密码时......
当应用程序启动时,我使用它来显示视图:
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
BOOL needsPassCheck = [def boolForKey:kHasPassword];
if (needsPassCheck) {
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil];
VerifyPasswordViewController *passC = (VerifyPasswordViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"passCheck"];
passC.loginCheck = YES;
self.window.rootViewController = passC;
}
这很好用......在另一种情况下,我使用
[self performSegueWithIdentifier:@"segueID"];
这是问题所在...在第一种情况下,键盘按计划显示...但在第二种情况下,它根本不显示...即使点击文本字段也不...
-(void)viewDidAppear:(BOOL)animated
{
[self.passwordTextField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.1f];
[super viewDidAppear:animated];
}
我毫不拖延地尝试了...没有变化...可能是什么问题?