I am making a small iOS application that tracks the amount of time that I have clocked in at work. I am very new to Swift and Xcode, so this is being a challenge for me. Details: I am using Xcode 7, the target development is 8.3. I believe I am missing something small like a class file. The app crashes on start up.
Error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ButtonIn.'
Code:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBOutlet weak var Lb1: UILabel!
@IBAction func ButtonIn(sender: AnyObject) {
self.Lb1.text = "Clocked In!"
}
@IBAction func ButtonOut(sender: AnyObject) {
self.Lb1.text = "Clocked Out!"
}
}