1

以下是我的故事板,導航欄是表示在情節串連圖板,但不模擬器

和的ViewController(CaseInfo或VC2)是表示導航欄

http://i.imgur.com/nQqj1IQ.png

但在我的模擬器導航酒吧dosen't出現!

在VC1(CaseList): 我做VC1是導航控制器

的rootView和我聯繫的VC1到VC2與選擇「推送」選項

然後我使用的代碼,當我點擊VC1的表項:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    CaseList *tagEditor = [self.storyboard instantiateViewControllerWithIdentifier:@"CaseInfo"]; 
    [self presentViewController:tagEditor animated:YES completion:nil]; 
} 

但在VC2導航欄不顯示

請幫我...

謝謝!

-

BTW

我還使用代碼VC2(CaseInfo)

- (void)viewWillDisappear:(BOOL)animated 
{ 
    [super viewWillAppear:animated]; 
    [self.navigationController setNavigationBarHidden:NO  animated:animated]; 
} 

回答

2

在你的代碼,因爲你有聯繫的VC2和VC1與賽格瑞

你只需要點燃它

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    [self performSegueWithIdentifier:@"segueid" sender:nil]; 
} 

然後在prepareForSegue中傳遞一些數據。

或者

可以刪除VC2和VC1

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    CaseList *tagEditor = [self.storyboard instantiateViewControllerWithIdentifier:@"CaseInfo"]; 
    [self.navigationController pushViewController:tagEditor animated:true]; 
} 
+0

之間的SEGUE謝謝!你立即解決我的問題,你拯救我的一天:) –

相關問題