2

This error seems common, but I can't seem to find a similar root cause as mine so the solutions aren't working.

I initially had single View Controller (VC 1) in my app, embedded in a Navigation Controller (NC).

I then added a second VC 2 and removed the NC from the VC 1. Then I embedded VC 2 in a NC and made it the initial view controller.

VC 2 is a Table View Controller that, when a cell is tapped:

  • instantiates VC 1,
  • alters a variable, and
  • uses navigationController to push VC 2

VC 2 contains a webView that does most of the work.

After setting all this up, I got a breakpoint and a warning that:

“View Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:].

I added a new NC back to VC 1 thinking that would fix things, but it didn't. Just changed to

“Navigation Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:].

Not sure if this is enough information, but is there a potentially clear solution here?

Edit: Adding the didSelectRowAt function in VC 2 that takes you to VC 1, in case it helps:

    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)
        }
    }
John
  • 231
  • 2
  • 8

2 Answers2

3

In the Storyboard select the view controller then Identity Inspector in the right pan and set Identity -> Storyboard ID to "Browser"

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
0

You have to set the navigation controller as the initial view controller to avoid this error, it wont appear as a "screen" anyway. You can then make the first storyboard that appears for the user by holding control then click and drag from the navigation controller to the screen of your choice.

Ekkogaming
  • 32
  • 8