我正在嘗試更改應用程序內我正在編輯代碼的視圖。但是當呈現一個新的視圖控制器時,導航欄在特定情況下似乎沒有更新。現在的行爲看起來是這樣的: 我通過單擊的TabBar選項卡上導航到tableviewcontroller, 然後我用導航到一個視圖控制器從這個tableviewcontroller:與UITabbar UINavigation不起作用
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];
,這是行爲開始變得越來越麻煩,導航欄不會更新到視圖控制器中的更改。我沒有寫這個代碼,但它一直在給我頭痛,試圖清理它。