0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Swift]新規プロジェクト起動するとCould not find a storyboard named ‘Main’ in bundle NSBundleでひたすら動かない

Last updated at Posted at 2019-11-30

状況

Main.storyboardを消してHome.storyboardとかを新しく作ったら

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

がでてクラッシュする

ポイント

  • Home.storybordにあるViewControllerと(例えば)HomeVCの紐付けはできている
  • Is Initial View Controllerはチェック入れてる
  • Main storyboard file base nameを消す or Main->Homeに変更も両方やった
    スクリーンショット 2019-12-01 0.22.00.png
  • Copy Bundle Resourcesにもドラッグした
    スクリーンショット 2019-12-01 0.23.56.png

対策

  • 初期で生成されるMain.storyboardは残したままプロジェクトの作成を続ける
    ->何らかの形で初期で生成したstoryboardの情報や参照状況が残っているからバグが起こる?
  • 名前を変えたい場合はMain.storyboard残したまま名前だけ変える or Main.storyboardの削除時にMove to trashせずに**Remove referenceするにとどめる**

参考

Could not find a storyboard named 'Main' in bundle NSBundle 対処方法 - Qiita
"Could not find a storyboard named 'Main' in bundle NSBundle" のエラーを吐いてしまい実機で動かない | makotton.com
xibをロードしようとしたらアプリ落ちる問題に少しハマったのでメモ - Qiita

0
3
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
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?