LoginSignup
14
6

More than 3 years have passed since last update.

"Could not find a storyboard named ‘Main’ in bundle NSBundle"に遭遇した時

Posted at

環境

  • macOS Catalina 10.15.4
  • Xcode11.4
  • TargetSDK iOS13.4

いつ遭遇したか

iOSアプリを作る際に、最初に表示したい画面の名前を変えたかったので、Main.storyboardのファイル名をSample.storyboardに変えてビルドすると、画面が描画されずに

Could not find a storyboard named ‘Main’ in bundle NSBundle

と表示されてクラッシュした。

Could not find a storyboard named 'Main' in bundle NSBundle 対処方法を参考に、info,plistのMain storyboard file base nameを消したり、Sampleに変えても効果なし。

解決方法

Xcode全体にMainで検索をかけてみると、info.plist内にもう一箇所Storyboardの名前を指定している箇所を見つけた。
スクリーンショット 2020-05-27 0.19.25.png
Application Scene Manifest

Scene Configuration

Application Session Role

Item 0 (Default Configuration)

Storyboard Name

これがMainになっていたので、Sampleに変更すると、無事にビルドできた。
ファイル名変えるだけなのにこんなトラップがあるとは...

14
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
6