LoginSignup
0
0

Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional valueについて

Posted at

はじめに

ボタンの表示をコードにしただけで、特にnilが発生しないところで、以下のようなエラーメッセージが出ました。

Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
スクリーンショット 2023-08-07 10.34.19.png

原因

いろいろと作業している間に、Outlet接続がなくなってしまい、Buttonそのものがnilになってしまった。「nilを入れようとしたから」ではなく「nilのまま使おうとしたから」というためのようでした。
スクリーンショット 2023-08-07 10.35.30.png

対策

再度Outlet接続をしたらエラーが解消されました。

参考資料

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