0
0

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 1 year has passed since last update.

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

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

どういう対応すると良いですか

このエラーメッセージは、Storyboard内のViewControllerが他のコンポーネントからアクセスされない、またはStoryboard IDが設定されていないことを示しています。対処方法としては以下の手順を試してみてください。

Storyboard IDの確認と設定:

XcodeでStoryboardファイルを開きます。
問題のあるViewControllerを選択します。
右側の属性インスペクターパネルで、"Identity Inspector" タブを開きます。
"Storyboard ID"フィールドに、一意のIDを入力します。このIDを使ってプログラムからインスタンスを生成できます。

Entry Pointの確認:

ViewControllerがアプリの起動時に最初に表示されるべきものであれば、そのViewControllerに対して「Is Initial View Controller」オプションを有効にします。
これは、StoryboardのCanvasで選択したViewControllerの上部にある小さな矢印をクリックして設定できます。

プログラムからの呼び出しの確認:

もしプログラムコードからViewControllerをインスタンス化する場合は、Storyboard IDを用いて正しく呼び出されているか確認してください。例えば、以下のようなコードを使用します。

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier: "YourViewControllerID")

これらのステップを実行後も問題が解決しない場合は、具体的なコードやエラーメッセージを元にさらに調査する必要があります。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?