3

当我使用 ECSlidingviewController 解散到控制器的最后一个时,返回到顶部控制器而不是父级;

我的控制器在情节提要中像这样订购;

InitialViewController (UIViewController) --> HomeNavigationController (UINavigationController) --> HomeController (UIViewController) --> MovieDetailController (UIViewController) --> CommentViewController (UIViewController)

在此之后呈现 CommentViewController 之前没有问题,它返回 InitialViewController

日志:MovieDetailController --> CommentViewController:

self = <MovieDetailViewController: 0xb3c15c0>
super = <HomeNavigationViewController: 0xa77c640>
nav_cont = (
"<HomeViewController: 0xa77c930>",
"<MovieDetailViewController: 0xb3c15c0>")

CommentViewController viewDidLoad:

self = <CommentViewController: 0x137154e0>
super = (null)
presenting = <InitialViewController: 0xb34ad70>
nav_cont = (null)

这行有问题:
presenting = InitialViewController: 0xb34ad70
应该是
MovieDetailViewController: 0xb3c15c0

4

1 回答 1

1

最后我想通了,如果在 InitialViewController ECSliding 之后给 UINavigationController 不能正常工作。UINavigatonController 必须是所有 UIViewController 的根。

这是错误的:

InitialViewController (UIViewController) --> HomeNavigationController (UINavigationController) --> HomeController (UIViewController) --> MovieDetailController (UIViewController) --> CommentViewController (UIViewController)

这是正确的:

HomeNavigationController (UINavigationController) --> InitialViewController (UIViewController) --> HomeController (UIViewController) --> MovieDetailController (UIViewController) --> CommentViewController (UIViewController)

于 2013-10-02T14:28:22.723 回答