我有一個iOS 5選項卡式應用程序,使用故事板。iOS 5試圖pushViewController從模態視圖
我的選項卡控制器指向三個導航控制器。
從他們中的一個,流看起來是這樣的:
開始視圖 - >照片視圖(模式) - >目錄視圖
在照片屏幕,我有以下按鈕代碼:
- (IBAction)acceptPhotoButtonPressed:(id)sender {
UIViewController *catalogView = [self.storyboard instantiateViewControllerWithIdentifier:@"CatalogView"];
[self.navigationController pushViewController:catalogView animated:YES];
}
我試着打打鬧鬧與presentingViewController
,parentViewController
- 甚至鍵入鑄造那些到UINavigationController
。這導致其崩潰,並顯示以下錯誤消息:
2012-04-06 00:32:45.808 myapp[19345:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBarController pushViewController:animated:]: unrecognized selector sent to instance 0x18d0d0'
這樣告訴我,我還沒有得到一個UINavigationController
的保持,但UITabBarController
。
有沒有解決這個辦法嗎?
您是否有首選資源可以通過故事板進行設置?當我設置一個新項目時,默認情況下起始視圖是UIView,而不是UINavigationView。如果有一種方法可以將UINavigationView設置爲初始視圖,那麼很高興看到! – Danny 2013-01-30 07:51:30