【发布时间】:2016-03-18 09:00:33
【问题描述】:
我希望生成一个导航列表。
我有一个 UITableViewController,如果单击一个单元格,我希望在 UITabeViewController 中显示的单元格的子级,并且应该出现一个后退按钮。
目前我做/做了这个测试:
var anz = 10
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return anz
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if anz<10 {
navigationController?.popToRootViewControllerAnimated(true)
}
anz = 5
self.tableView.reloadData()
}
但是没有返回按钮(当然)。
所以它应该是这样的:
谢谢。
【问题讨论】:
-
细胞的孩子是什么意思?
-
像category这样的数据结构的一个类别可以有一个“子”-category
-
您想要在单元格中还是在导航栏中添加后退按钮?这段代码在视图控制器类中吗?这个视图控制器是导航控制器的孩子吗?请提供更多代码。
标签: ios iphone swift uitableview