[英]How to present hierarchical data using tableviewcontroller in ios
Am a newbie to ios development. 是ios开发的新手。
Building a simple app that lets users navigate hierarchical data. 构建一个允许用户导航分层数据的简单应用。 For eg, navigating directory structures.
例如,导航目录结构。
We built a TreeViewController and set the data source to the first level. 我们构建了一个TreeViewController并将数据源设置为第一级。 What's not clear is to how to initialize the same controller and push it so that the next level can be represented.
不清楚的是如何初始化同一个控制器并推送它以便可以表示下一个级别。
I tried the following: 我尝试了以下方法:
UIStoryboard *storyboard = [self storyboard];
CVBrowseViewController *selfController = [storyboard instantiateViewControllerWithIdentifier:@"browseTable"];
//Push the new table view on the stack
[self.navigationController pushViewController:self animated:YES];
[selfController setFolderList:children];
However, this throws an error: Pushing the same view controller instance more than once is not supported 但是,这会引发错误:不支持多次推送相同的视图控制器实例
This line: 这一行:
[self.navigationController pushViewController:self animated:YES];
should be: 应该:
[self.navigationController pushViewController:selfController animated:YES];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.