Could not find a storyboard named 'main' in bundle NSBundle

What does this error mean?

"Could not find a storyboard named 'main' in bundle NSBundle"

Accepted Reply

Isn't the message clear enough?

Your app tried to find a storyboard named 'main', but could not find it in the spedified NSBundle.

The bundle may very likely be your app bundle.

Thus, your app does not contain main.storybord even though some parts of your code trying to access it.


A storyboard `main.storyboard` is not includeded in usual app template. (Usual app template uses `Main.storyboard` not `main.storyboard`.)

Find where in your code or settings your app trying to access that.

  • No, it is not Clear because it leaves our one importunt consideration. The file being looked for was supposed to be in an Apple supplied folder which it was not. In the case on this machine the file should have been in a system Library. After all, the message came out of execution for an APPLE SUPPLIED DEMO. Clearly if it was a demo, it was not well constructed.

Add a Comment

Replies

Isn't the message clear enough?

Your app tried to find a storyboard named 'main', but could not find it in the spedified NSBundle.

The bundle may very likely be your app bundle.

Thus, your app does not contain main.storybord even though some parts of your code trying to access it.


A storyboard `main.storyboard` is not includeded in usual app template. (Usual app template uses `Main.storyboard` not `main.storyboard`.)

Find where in your code or settings your app trying to access that.

  • No, it is not Clear because it leaves our one importunt consideration. The file being looked for was supposed to be in an Apple supplied folder which it was not. In the case on this machine the file should have been in a system Library. After all, the message came out of execution for an APPLE SUPPLIED DEMO. Clearly if it was a demo, it was not well constructed.

Add a Comment

Thank you for your answer.

I am new to swift and xcode so I couldn't get immediately.


The problem was in this line:

let mainStoryBoard = UIStoryboard(name: "main", bundle: Bundle.main)

so I changed it to:

let mainStoryBoard = UIStoryboard(name: "Main", bundle: Bundle.main)

and it worked!