I’m taking the Angela Yu class on programming and am in module 11. We’re studying about customized view controllers. I unintentionally encountered an error and am searching for to raised perceive it.
Code under relies on my understanding of correct implementation of MVC framework. This isn’t the code that Angela makes use of.
My code that leads to an error
When calling calculatePressed() by urgent the calculate button, I get a deadly error that an surprising nil is encountered when unwrapping an elective.
Angela’s code as she writes it fixes the issue. I’m searching for to grasp why this works, not questioning her resolution.
Within the resolution code, there is no such thing as a updateUI() and there are IBOutlets created to the sliders. I am undecided why this may repair the difficulty, as there are not any optionals faraway from the code; the one two unwrapped optionals I see are the IBOutlets for weightLabel and heightLabel.