此错误似乎很常见,但我似乎找不到与我类似的根本原因,因此解决方案无法正常工作。
我最初在我的应用中有一个View Controller(VC 1),嵌入在导航控制器(NC)中。
然后我添加了第二个VC 2,并从VC 1中删除了NC。然后,我将VC 2嵌入了NC中,并使其成为初始视图控制器。
VC 2是一个表视图控制器,当点击一个单元格时:
VC 2包含完成大部分工作的webView。
设置完所有这些之后,我得到了一个断点和一个警告:
“View Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:].
我向VC 1添加了一个新的NC,以为可以解决问题,但是没有解决。刚刚更改为
“Navigation Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:].
不确定这是否足够的信息,但是这里是否有潜在的清晰解决方案?
编辑:如果有帮助,可以在VC 2中添加didSelectRowAt函数,使您进入VC 1:
override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
if let vc = storyboard?.instantiateViewController(withIdentifier: "Browser") as? ViewController {
vc.selectedWebsite = websites[indexPath.row]
vc.approvedWebsites = websites
navigationController?.pushViewController(vc, animated: true)
}
}
在情节提要中选择视图控制器,然后在右窗格中选择Identity Inspector
并将Identity -> Storyboard ID
设置为“浏览器”