Fatal error: Unexpectedly found nil while unwrapping an Optional value
Let's translate first!
Nil was unexpectedly found while unwrapping an optional form value
is.
For those who are developing with Storyboard,
If you get this error, it's because ** 60% ** isn't associated!
This, ** 60% ** is relatively important. (* This is my skin feeling)
If this error text is written in a text that contains a @IBOutlet
connection,
Let's check if it can be associated.
XCode is convenient, If it is associated, ◉ If not, ○ Will display it at the line. (Although it is sometimes associated, it may be displayed as ○, but ...)
That is the end of the association.
By the way, when you add @IBOutlet
(say" when "@IBOutlet` is an option"), add "!"! !! !! See here for people!
[Why should IBOutlet be defined with "!"] [Link-1]]
[link-1]:https://qiita.com/Lulu34/items/791ad052a6dce480175c
It's literally translated.
What I want you to keep in mind
The contents of the box will contain a value.
In this image, it means that there is some value in the box called "a".
Click here for a review of variables.
There is no value in this box (that is, the state of nil), and I am trying to process it in that state, so it is a pattern out!
All you have to do is put a value in an empty variable. Be careful when you put values in variables. ① The programming code in the function is read from top to bottom ② In most cases, the viewDidLoad function is read first.