Currently, I've been following a Coursera course called Intro to Swift Programming 5. The video I was following was about the Xcode's MVC, and I'm getting the following error, even though I did what the person on screen had done:
Thread 1: Exception: "[< UIViewController 0x7fd2b6c053d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key colorLabel."
I've tried looking it up, but I don't see where I would have referenced something and deleted it. I've also checked to see if there are any warning signs near any of my reference outlets on the Main Storyboard, but everything seems to be in order there as well.
My code is as follows:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var modelLabel: UILabel!
@IBOutlet weak var colorLabel: UILabel!
@IBOutlet weak var priceLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
let appleProduct = AppleProduct(name: "iPhone X", color: "Space Gray", price: 999.99)
modelLabel.text = appleProduct.name
colorLabel.text = "in \(appleProduct.color)"
priceLabel.text = "$\(appleProduct.price)"
}
}
Has anyone else experienced this issue and can help me? I'd greatly appreciate it, and I'm happy to provide any other code that's needed if this is unclear. Thanks!