小编Pee*_*etz的帖子

如何从rootViewController中的多级导航更新detailViewController.detailItem

这是我的第一篇文章,所以请轻轻一点.

我在xcode中使用基于Split View的基本应用程序,但已对其进行了编辑,以便rootViewController不会简单地更新detailViewController,而是将新的UITableViewController(taskViewController)推送到导航堆栈.

我的问题是,当我从taskViewController调用以下内容时没有任何反应:

detailViewController.detailItem = [NSString stringWithFormat:@"Row %d", indexPath.row];
Run Code Online (Sandbox Code Playgroud)

如果我从rootViewController调用它,而不是将新的UITableView推送到堆栈,它可以工作.

当选择一个单元格时,这是我的rootViewController代码:

- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    TaskViewController *taskViewController = [[TaskViewController alloc] init];

    taskViewController.title = [NSString stringWithFormat:@"Unit %d",indexPath.row];

    [self.navigationController pushViewController:taskViewController animated:YES];

    [taskViewController release];
}
Run Code Online (Sandbox Code Playgroud)

我在这里做错了吗?我在UISplitViewController的rootViewController中正确使用导航控制器吗?

xcode ipad uisplitviewcontroller

2
推荐指数
1
解决办法
2947
查看次数

标签 统计

ipad ×1

uisplitviewcontroller ×1

xcode ×1