【发布时间】:2014-03-26 11:29:57
【问题描述】:
我正在尝试更改我正在为其编辑代码的应用程序中的视图。但是在呈现新的视图控制器时,导航栏似乎没有在特定情况下更新。现在行为看起来像这样: 我通过单击选项卡栏中的选项卡导航到 tableviewcontroller, 然后我使用以下 tableviewcontroller 导航到 viewcontroller:
settingsController = [SettingsController create];
[self.navigationController pushViewController: settingsController animated: YES];
我相信它称之为代码:
+(id)create
{
SettingsController*settings = [[SettingsController alloc] init];
NSBundle*bundle = [NSBundle bundleForClass: [SettingsController class]];
[bundle loadNibNamed: @"SettingsController" owner: settings options: NULL];
settings.view.frame = CGRectMake(0, 0, 320, 411);
settings.title = @"Settings";
return settings;
}
然后我从那里导航到另一个视图控制器:
SearchViewController*searchView;
searchView = [[SearchViewController alloc] initWithNibName:@"SearchView" bundle: [NSBundle mainBundle]];
[self presentViewController:searchView animated:YES completion:nil];
这就是行为开始出现错误的地方,导航栏不会更新到视图控制器中的更改。这段代码不是我写的,但是清理它让我头疼。
【问题讨论】: