ストーリーボードを使用して、iOS 5 タブ付きアプリケーションがあります。
私の Tabbar Controller は 3 つの Navigation Controller を指しています。
そのうちの 1 つから、フローは次のようになります。
開始ビュー --> 写真ビュー (モーダル) --> カタログ ビュー
写真の画面には、次のコードのボタンがあります。
- (IBAction)acceptPhotoButtonPressed:(id)sender {
UIViewController *catalogView = [self.storyboard instantiateViewControllerWithIdentifier:@"CatalogView"];
[self.navigationController pushViewController:catalogView animated:YES];
}
私は , をいじってみましたpresentingViewController
-parentViewController
それらを a にキャストしたタイプでさえ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
。
これを回避する方法はありますか?