我的观点的结构如下。我在 UITableView 的标题视图中显示目录每一章的封面,并在相应的表视图中显示每一章的小节。我将这些全部嵌入到分页 UIScrollView 中,它是导航控制器的 rootViewController。堆栈是:
UINavigationController (controlled by CatMainViewController [UIViewController])
UIScrollView (controlled by CatMainViewController [UIViewController])
UITableView (controlled by SectionViewController [UITableViewController])
我想知道如何通过 SectionViewController 上的 didSelectRowAtIndexPath 方法与 CatMainViewController 进行通信,以告诉导航控制器推送加载文档的视图控制器。
我试过类似的东西:
#import "CatMainViewController.m"
[CatMainViewController.self.navigationController pushViewController:newView animated:YES];
但显然这并没有那么好。任何帮助将不胜感激!谢谢。