我试图从一个视图(一个完全正常的视图)切换到另一个可编程的视图(也是正常的)。这是我已经存在的代码:
- (IBAction)login:(id)sender {
if([_username.text isEqualToString:name] && [_password.text isEqualToString:pw]) {
DashboardViewController *destinationController = [[DashboardViewController alloc] init];
[self.navigationController pushViewController:destinationController animated:YES];
}else {
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Wrong Username or Password!"
message:@"Sorry."
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil, nil];
[message show];
_password.text = nil;
}
}
所以,我想定向到我的DashboardViewController
. 如果我尝试此代码,则会显示一个黑色的空视图。它有什么问题?