Philipp Koopmans
Philipp Koopmans

Reputation: 411

Error: unreachable because it has no entry points

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?

Upvotes: 39

Views: 57762

Answers (13)

cesareressa
cesareressa

Reputation: 336

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

Upvotes: 3

Kibernetik
Kibernetik

Reputation: 3028

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.

Upvotes: 0

oskarko
oskarko

Reputation: 4178

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

Upvotes: 2

Rashwan L
Rashwan L

Reputation: 38833

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

Upvotes: 51

Prabhu.Somasundaram
Prabhu.Somasundaram

Reputation: 1390

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.

Upvotes: 1

eowyn
eowyn

Reputation: 1

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

Upvotes: 0

Mikkel Wind
Mikkel Wind

Reputation: 1

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

Upvotes: 0

Abdullah Ahçı
Abdullah Ahçı

Reputation: 806

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

Upvotes: 1

KongJing
KongJing

Reputation: 475

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.

Upvotes: 0

Christopher
Christopher

Reputation: 6066

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.

Upvotes: 4

appmaster
appmaster

Reputation: 63

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!

Upvotes: 3

Vitya Shurapov
Vitya Shurapov

Reputation: 2318

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

Upvotes: 14

Suhit Patil
Suhit Patil

Reputation: 12023

Set Your TableViewController an Initial View Controller from the Storyboard

enter image description here

Upvotes: 7

Related Questions