37

Using Swift I got the error that my "TableViewController" is unreachable because it has no entry points and no runtime access via [UIStoryboard instantiateViewControllerWithIdentifier].

In my View Controller class there is the suggestion to fix it while changing instantiateViewController(withIdentfier...) in instantiateViewController(withIdentifier).

Shall I do this or how do I fix this?

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
Philipp Koopmans
  • 391
  • 1
  • 3
  • 3
  • 3
    Welcome to Stack Overflow. Try to post the code. Create a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) – pedrouan Oct 04 '16 at 08:16
  • 4
    There isn't really code to post in this case, because the problems and solutions are all exposed through the UI (especially for beginners). – Hannele Jan 25 '17 at 21:04
  • had a similar issue with one of my view controllers not being identified and this fixed the issue https://stackoverflow.com/questions/15478411/how-do-i-give-an-identifier-to-a-view-controller-within-my-storyboard – user137786 Dec 25 '17 at 04:22

13 Answers13

47

You need to mark a viewController in your Storyboard and set it to the initial viewController. You do this under the Attributes Inspector. This means that you set which viewController shall open when you start your application.

enter image description here

Rashwan L
  • 38,237
  • 7
  • 103
  • 107
  • 3
    In my scenario, I have one storyboard in which there are two entry points depending upon whether user has logged in or not. One of the view controller is marked as "Initial" so it's giving me "unreachable" warning for another view controller. How do I get rid of that? –  Feb 13 '17 at 11:30
  • 1
    @NileshPol, create a segue to the unreachable viewController so that you always go to the initial one. If you´re logged in segue to the other viewController. – Rashwan L May 27 '17 at 09:06
  • Why did you not checked `Is Initial View Controller` in your Screenshot?! – Black Jul 10 '19 at 13:41
14

I'd reached the same error. This answer would be useful, I think: Xcode: "Scene is unreachable due to lack of entry points" but can't find it

The problem was that because of some experiments and copy-pasting I had an actual copy of a view controller located outside the visible part of the screen or it could be stacked exactly on top of its twin. So I just deleted unwanted one :-) You should open Document Outline and сheck for copies :-)

Document Outline is showing 2 the same ViewControllers

Community
  • 1
  • 1
Vitya Shurapov
  • 2,200
  • 2
  • 27
  • 32
7

Set Your TableViewController an Initial View Controller from the Storyboard

enter image description here

Suhit Patil
  • 11,748
  • 3
  • 50
  • 60
4

I fixed this by renaming the default "ViewController.swift" as "MainViewController.swift". Perhaps this is a warning to the user to insure everything is defined as you expect it to be.

I experienced this issue again and backtracked, eventually clearing the storyboard and then deleting it entirely from the project and the issue was still present. Relaunching Xcode fixed the issue.

Christopher
  • 5,806
  • 7
  • 31
  • 41
  • 3
    Thanks! That's a helpful tip, particularly: **Relaunching Xcode fixed the issue**. In my case, I had added a standalone view controller which didn't originally have a storyboard identifier, and which Xcode was rightfully warning me about. However, I was confused, because even after I added a storyboard identifier, I kept getting the warning every time I built. Relaunching Xcode fixed the issue. :) – brookinc Sep 04 '17 at 22:57
  • 1
    that totally worked for me. Same problem as above TabBarController + 2 VC. One generating the warning. Restarted XC et voila. Thanks again. – MoVod Feb 03 '18 at 09:51
3

For me I just had a view controller that wasn't attached to anything, i.e. I had a UITabBar Controller, and a few View Controllers attached to the TabBar, but there was one View Controller that was stranded, with out any connection to another view.

From my experience, the error message was,

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

The View controller name was the text in quotes, i.e. “View Controller“.

Hope this helped someone!

appmaster
  • 63
  • 6
  • So this just means it is safe to ignore this warning? I have the same scenario, but I actually defined the Storyboard ID and I am instantiating it in code. So it is confusing to still get the warning. On the other hand, would you use the stranded View Controller otherwise? – Efren May 09 '17 at 05:27
  • @Efren I have ignored the warning before and you could too. I'll try to make this clearer: I had a TabBarController (that was the initial VC) that was connected to three VC's (There were three TabBar icons). I had a forth VC that was not connected to the TabBarController (or anything else), thus could never be accessed via the app interface. This VC was the one throwing the error, because as far as Xcode was concerned it was useless, never being accessible. It doesn't matter what code is used, it only matters what connections are made in the Storyboard. Make more sense? VC = ViewController FYI – appmaster May 09 '17 at 05:41
  • 2
    Thanks for the reply, I understood the VC story, but in my case I did add the Identifier, so the warning should have gone. It would be nice to get rid of the warning safely. I kept searching for the problem after having more troubles in the same VC and in the end it was related to this: http://stackoverflow.com/a/18057555/1736679 – Efren May 09 '17 at 07:18
  • @Efren Glad you understood, when I reread my answer, I thought it was a little confusing. As I understand it, the VC that was causing you issues was connected to another VC or was the initial VC? Anyway, I'm glad you figured it you and thanks for the link! – appmaster May 09 '17 at 15:54
2

Just add an ID in Storyboard ID (and restoration ID in case) enter image description here

oskarko
  • 3,382
  • 1
  • 26
  • 26
2

I solved my issue as follows:

  1. Make sure the storyboard is Initial View Controller enter image description here

  2. In Custom Class, the selected class is ViewController enter image description here

cesareressa
  • 326
  • 2
  • 9
1

In my case I accidentally deleted Storyboard Entry Point without knowing, and app wasn't starting,

After several undo's, I saw the problem and corrected it

enter image description here

Abdullah Ahçı
  • 786
  • 10
  • 19
1

When you have 2 or more navigation controllers(embedded UIVIewcontrollers) or 2 or more UIViewcontrollers in your storyboard. Xcode may be looking for a startup view controller. You can mark either of one of them as startupviewcontroller, just by selecting the "is initial viewcontroller" enter image description here

OR you can give a unique storyboard id for each and every UInavigationcontrollers or UIViewcontrollers or UITabviewcontrollers in your storyboard.

Prabhu.Somasundaram
  • 1,380
  • 10
  • 13
0

This is my error.

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

enter image description here I delete the code in ViewController , but I don't disconnect the connect in ViewController of Main.storyborad.

KongJing
  • 475
  • 5
  • 7
0

I had the same problem. I figured out that I had forgotten to add an "ID" to my Tab Bar Controller. Hope this help somebody.

enter image description here

SOS
  • 6,430
  • 2
  • 11
  • 29
0

I had same issue that to solve this problem I opened the Document Outline then realized that I have accidentally deleted the Segue between two pages.

Steps:

1) Editor> Show Document Outline document outline

2) Check the Document Outline for any copy-paste, segue error or etc. screenshot

Gufran Hasan
  • 8,910
  • 7
  • 38
  • 51
eowyn
  • 1
  • 2
0

The problem is exactly as the warning says: this View Controller is unreachable because it has no entry points.

If you have only one View Controller then this controller is missing its entry point. You can fix this by setting this View Controller as "Is Initial View Controller".

If you have several View Controllers and this View Controller is not in the beginning of your storyboard sequence, then you are missing a segue which should display this View Controller. You can fix this by adding a segue which should show this View Controller.

In general, Xcode tells you that this View Controller is not connected to the storyboard sequence because it has no incoming connections.

Kibernetik
  • 2,947
  • 28
  • 35