UINavigationController忽略上一个viewcontroller

通过AppDelegate创建的UINavigationController

推进新的view controller时,需要navigationItem不断接受新的view controller信息,忘记上一个view controller,并且显示当前view controller的title。

怎么样实现这个?我在viewDidLoad中设置了当前view controllerleftBarButtonItem

self.navigationItem.leftBarButtonItem = nil;

但是无效。谢谢帮忙

在新view controller用navigationItem方法因此后退按钮

setHidesBackButton

在新view controller中用下面代码:

- (void)viewDidLoad
{
    [super viewDidLoad];

    // 隐藏导航后退按钮

    [self.navigationItem setHidesBackButton:YES];
}