我有一个类似的视图控制器
联络
在iPhone中。代码是这样的,
tabBarController = [[UITabBarController alloc] init];
friendsVC = [[RemittanceFriendsVC alloc] initWithNibName:@"RemittanceFriendsView" bundle:nil];
friendsVC.friendsArray = [[RemittanceModel getInstance] friends];
UINavigationController *friendsNVC = [[UINavigationController alloc] initWithRootViewController: friendsVC];
[controllers addObject:friendsNVC];
tabBarController.viewControllers = controllers;
汇款friendsvc是uitableviewcontroller,单击单元格进入详细信息视图。我在viewcontroller(vc)中设置了“modal”变量,以了解它是否作为modal加载。因为它是选项卡栏项的一部分,(非模态视图),所以工作正常。但是,当我将其作为模式vc加载时,当我单击表单元格时,我想解除模式视图,但它没有解除模式视图。
在friendvc中,这不起作用,
-(void) didPressCancelButton {
[self.navigationController dismissModalViewControllerAnimated:YES];
}
我想做的是,将同一个vc用作选项卡栏项,有时也用作模式vc。不可能吗?