简体   繁体   English

如何在ios中使用tableviewcontroller呈现分层数据

[英]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.

相关问题 如何将数据从Firebase iOS从TableViewController传递到另一个ViewController - How pass data from Firebase iOS from a TableViewController to another ViewController 在TableViewController中将NSMutableArray与JSON数据一起使用 - Using NSMutableArray in TableViewController with JSON data 如何使用委托将数据从第二个ViewController传递到TableViewController - How to pass data from 2nd viewcontroller to tableviewcontroller using delegates iOS 嵌套/分层数据 - iOS Nested / hierarchical data 如何使用导航将字符串从一个tableViewController传递到其他tableViewController - How to pass a string from one tableViewController to other tableViewController using navigation iOS-如何在TableViewController中设置TableView的宽度? - iOS - How to set width of TableView in TableViewController? 使TableViewController成为TableViewController的子视图(ios) - Making a TableViewController a subview of a TableViewController (ios) iOS - 如何将分层数据表示为具有2个场景的主/详细模板 - iOS - how to represent hierarchical data as master/detail template with 2 scenes 使用JSONModel时,Json数据未显示在TableViewController上 - Json data is not showing on TableViewController when using JSONModel 如何将数据从数组显示到TableViewController-Swift - how to display data from array into tableviewcontroller - swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM