2013-10-16 68 views
0

我已經開始使用storyboard的iOS應用程序。在我的應用程序中,mainStoryBoard從導航控制器開始。從導航的視圖控制器,我通過編程方式將控制器傳遞給第二個視圖控制器,並通過編程方式推送([self performSegueWithIdentifier:@"currencyClick" sender:self])。在第二個視圖控制器上,我有一個按鈕。點擊按鈕時,我想回到導航的視圖控制器,如[self.navigationController popViewControllerAnimated:YES],但這裏的self.navigationController popViewControllerAnimated:YES不起作用。在我的項目中,我在Navigationcontroller中取消了Shows navigation Barxcode 4.5中的iOS Storyboard

NavigationController-(根的ViewController) - >的viewController - (推賽格瑞與[自performSegueWithIdentifier:@ 「currencyClick」 發件人:自];) - > CurrencyViewcontroller

在currencyviewController我有一個按鈕。在按鈕上單擊我想要實現導航後退按鈕單擊事件。如何以編程方式實現BACK按鈕,[self.navigationController popViewControllerAnimated:YES]在這種情況下不起作用。

enter image description here

請幫我解決這個問題..提前

+0

顯示您的代碼。 –

回答

2

感謝您的第一個視圖控制器使用調用secondcontroller:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"mainStoryBoard" bundle: nil]; 

SecondViewController *rvc = (SecondViewController *)[storyboard instantiateViewControllerWithIdentifier:@"SecondViewControllerNameInYourStoryBoard"]; 

[self.navigationController pushViewController:rvc animated:YES ]; 

,而不是自我performSegue ...然後在你的第二個控制器彈出應該工作。

+0

謝謝盧西亞諾羅德里格斯。 – Jithin