问题描述
我正在使用示例程序中显示的示例 ViewController 作为presentModalViewController.但是,我想在 UIViewController 上使用 pushViewController .问题是当我切换到 pushViewController 时,ViewController 没有正确显示.调用了 ViewController 中的函数,但我什么也没看到.我改回presentModalViewController,一切正常.
I am using a sample ViewController that is displayed in the sample program as a presentModalViewController. However, I want to use pushViewController on the UIViewController instead. The problem is that when I switch to pushViewController, the ViewController no displays properly. Functions in the ViewController are called, but I don't see anything. I change back to presentModalViewController and everything works.
问题是我需要做什么才能使 pushViewController 工作?
The question is what do I need to do to make pushViewController work?
FCVC *fcVC;
NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"fcVC"
owner:self
options:nil];
fcVC = [array objectAtIndex:0];
A.[self presentModalViewController:fcVC animation:YES];
//"WORKS"
或
B. [self.navigationController pushViewController:fcVC animation:YES];
//"不起作用
A. [self presentModalViewController:fcVC animated:YES];
// "WORKS"
or
B. [self.navigationController pushViewController:fcVC animated:YES];
// "Doesn't work
推荐答案
你真的设置了 UINavigationController 吗?self"应该是一个加载到 UINavigationController 中的 viewController.
Do you have a UINavigationController actually set up? "self" should be a viewController that is loaded inside UINavigationController.
这篇关于交换 presentModalViewController 和 pushViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!