Wednesday, June 10, 2026
HomeiOS Developmentios - Unexpectedly discovered nil whereas implicitly unwrapping an Non-compulsory worth for...

ios – Unexpectedly discovered nil whereas implicitly unwrapping an Non-compulsory worth for my UILabel

[ad_1]

I’m attempting to assign some textual content to one in every of my UILabels, however I preserve getting the error, “Deadly error: Unexpectedly discovered nil whereas implicitly unwrapping an Non-compulsory worth.” I attempted different stackoverflow options however nothing appears to be working. I’m particularly confused with this example as a result of, in all my different viewcontrollers, I’ve been assigning textual content to the labels this very same method, however there appears to be an issue in simply this one class.

class AuthorizationVC: UIViewController
{

      @IBOutlet weak var authorMessage: UILabel!
      override func viewDidLoad()
      {
            tremendous.viewDidLoad()
            authorMessage.textual content = "Please enter your username and password to entry 
            this protected file." //Error exhibits up right here
      }
 }

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments