【发布时间】:2014-08-07 14:47:51
【问题描述】:
我在标签栏页面上有一个UITableView。现在,如果我点击UITableViewCell,我想推送到一个新的标签栏控制器。
我的故事板现在看起来像这样:
我的问题是当我点击单元格时,它会打开新页面(图中右上角的Controller),但TabBar仍然和以前一样,即使我设置了导航栏标题也是空的( self.title = @"Test";)
这里有一些代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"segue" sender:self.view];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"segue"])
{
NSIndexPath *indexPath = [myTableView indexPathForSelectedRow];
self.myTabbarController = (UITabBarController*)[segue destinationViewController];
self.topRightController = [self.myTabbarController.viewControllers objectAtIndex:0];
self.topRightController.value = [Values objectAtIndex:indexPath.row];
}
}
有人可以帮我解决这个问题吗?
【问题讨论】:
-
@danh 这是一个push segue,因为我想在push到第二个之后回到第一个TabBarController
-
如果你在第一个 tabbarcontroller 中只使用一个 tab 为什么要把它当作 tabbar 控制器
-
@sreekanthk .. 这只是一个演示。我实际的故事板要大得多。
标签: ios uitableview uinavigationcontroller uitabbarcontroller segue