I have the following code:
func textSwitch(t: UILabel) {
if(t.hidden == true) {
t.hidden = false
}
else{
t.hidden = true
}
}
@IBOutlet weak var recordingtext: UILabel!
@IBAction func recordButton(sender: UIButton) {
textSwitch(recordingtext)
}
Running it results in the NSUknownKeyException. I am very new to iOS and Swift. Can anyone help me understand not just how to fix this, but why the code will not run? From looking at other questions it looks as if this exception is normally thrown when the object being referenced doesn't exist, but I do not believe that is the case here? I really don't know enough to be certain at this point.