【发布时间】:2018-02-15 18:53:10
【问题描述】:
我有一个具有相同单元格的 tableView。选择其中一个后,我想打开另一个 ViewController。 我试过这段代码:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: IndexPath) {
let destination = EditViewController()
navigationController?.pushViewController(destination, animated: true)
}
但它没有打开另一个 ViewController。 能给个提示吗?
【问题讨论】:
-
您是否在 Storyboard 中嵌入了带有导航控制器的视图控制器?
-
“没用” == 没有变化或空白屏幕或...?
-
我的意思是:没有变化
-
检查navigationController是否存在。
标签: ios swift uitableview uiviewcontroller