这个错误似乎很常见,但我似乎找不到与我类似的根本原因,因此解决方案不起作用。
最初,我的应用程序中有单视图控制器(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)
}
}发布于 2020-01-17 00:36:57
在Storyboard中,选择视图控制器,然后在右边的pan中选择Identity Inspector,并将Identity -> Storyboard ID设置为"Browser“
发布于 2020-07-09 21:20:20
您必须将导航控制器设置为初始视图控制器,以避免此错误,无论如何,它不会显示为“屏幕”。然后,您可以通过持有控件为用户创建第一个故事板,然后单击导航控制器并将其拖到您选择的屏幕上。
https://stackoverflow.com/questions/59779639
复制相似问题