我的应用程序有一个主屏幕 ( mainView)。开mainView,我有一个按钮。当用户点击它时,我使用
[self presentViewController:libraryView animated:YES completion:nil]
呈现另一种观点 ( libraryView)。然后,在 上libraryView,我使用
[self.view addSubview:tabBarController.view]
添加一个UITabBarController有 2 个视图控制器的:featuredBooks和recentBooks
一切正常。但是当我添加一个按钮来featureBooks关闭libraryView并返回时mainView,以下方法不起作用
[self dismissViewControllerAnimated: YES completion:nil]
[self.parentViewController dismissViewControllerAnimated: YES completion:nil]
[self.presentingViewController dismissViewControllerAnimated: YES completion:nil]
我知道原因:self指featureBooks的是 的观点,而不是libraryView。
那么,我如何引用libraryView、关闭它并从Tab Bar Controller 内mainView的视图控制器(featureBooks或)返回?recentBooks
非常感谢。