私は、水平ページングUIScrollViewのデリゲートを管理し、その役割を果たすルートUIViewControllerサブクラス(PagingViewController)を含むUINavigationControllerを持つアプリケーションを持っています。このUIScrollViewの各ページには、垂直にスクロールするUITableViewがあり、それぞれ独自のUIViewControllerサブクラス(PageViewController)で管理されています。 PagingViewControllerの上にPageViewController(のUITableViewデリゲート)の方法は、UINavigationControllerに新しいのUIViewControllerを押して(:それはこのような何か...私が何をしたいのですがどのようなネストされたUIViewControllerはルートUINavigationControllerにプッシュする必要があります
UINavigationController
PagingViewController (root VC of navigation controller)
PageViewController (instance 1)
PageViewController (instance 2)
PageViewController (instance 3)
HowToPushThisViewController (this is what I'd like to push onto the current root, PagingViewController, from one of its sub view controllers)
はdidSelectRowAtIndexPathで、あるように見えます)。
PageViewControllerのnavigationControllerプロパティがnilなので、そこにプッシュできません。私はUINavigationControllerのスタックに直接ではないのでこれがゼロであると仮定しますが、はがであるPagingViewControllerによってを含んでいます。私はPagingScrollViewにそれを追加する前に各PageViewControllerのnavigationControllerプロパティを設定しようとしましたが、読み込み専用のようです(どのようにUINavigationController自体が設定されていますか?)。
入れ子になっているUIViewControllerは健全なアーキテクチャです(それぞれのビューのデリゲートを管理し、その役割を果たすために必要です)。サブコントローラからナビゲーションをプッシュすることは妥当です。ネストされたコントローラにアクセスしてプッシュする練習。うまくいけば、私はルートnaviagtionコントローラにアクセスしてプッシュすることを見落としている何か簡単です。
経由でnavコントローラにアクセスできます。あるいは、-parentViewControllerをオーバーライドします。これは、(私が思う)-navigationControllerを含むいくつかのUIViewControllerの魔法を働かせるようです。しかし、Icky! –