【发布时间】:2011-06-20 09:01:52
【问题描述】:
我有一个带有 UINavigationController 的 UITabbarController。 NavigationController 中的视图呈现一个 MVC (AddClockNavigationController)。这个 MVC 有一个带有视图的 nib 和一个 UINavigationController。 NavigationController.view 作为子视图添加到 MVC 的视图中。
我的 MVC 中的 NavigationController 有两个按钮,一个 Cancel 和一个 Done。当按下其中任何一个时,MVC 应该被关闭。 这些按钮的 IBAction 位于 UINavigationController 的视图 (AddClockViewController) 中,但无论何时按下它们,MVC 都不会消失。 如果我将动作放入 MVC,它就会消失。 如果我将函数放在我的 MVC 中并使用 [self.parentViewController myFunction] 从我的 viewController 调用它,它不会消失。
我怎样才能让它从我的视野中消失?
我想我的解释很混乱,但我希望你能理解。
我的 IB 的观点:
最好的问候,
保罗·皮伦
编辑
我已经用[self dismissModalViewControllerAnimated:YES];、[self.parentViewController dismissModalViewControllerAnimated:YES];、[self.navigationController dismissModalViewControllerAnimated:YES];、[self.parentViewController.navigationController dismissModalViewControllerAnimated:YES]; 尝试了这个,并且如前所述,在 parentView 中使用了一个函数来解除它。没有任何效果。
【问题讨论】:
标签: iphone model-view-controller ios uinavigationcontroller