我是 iPhone 开发的新手。我使用storyboard创建了一个使用导航栏的应用程序。我的问题是我在按钮单击时以编程方式从 viewA打开viewB并且它成功。现在回到viewA ,我使用了取消按钮。当我单击取消按钮(上一个)时,(viewA)打开但导航栏未显示。和 viewA 有导航栏控件,但viewB没有。
提前致谢
查看 A
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
EditViewController *viewController = (EditViewController *)[storyboard instantiateViewControllerWithIdentifier:@"EditViewController"];
[self presentViewController:viewController animated:NO completion:NULL];
视图 B:
- (IBAction)cancelButtonPressed:(id)sender {
if ( lables != NULL) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
ScannerViewController *viewController = (ScannerViewController *)[storyboard instantiateViewControllerWithIdentifier:@"ScannerViewController"];
[self presentViewController:viewController animated:NO completion:NULL];
}
else{
[self.navigationController popViewControllerAnimated:YES];
}