Sorry I do not have specific question but I cannot figure out how to get around this error. The app itself does not show any errors in Xcode but it crashes at start with the error message this class is not key value coding-compliant for the key guessMade.
@IBOutlet weak var numberGuessed: UITextField!
@IBOutlet weak var answer: UILabel!
@IBAction func guessMade(sender: AnyObject) {
var numberOfFingers = arc4random_uniform(11)
var numberString = String(numberOfFingers)
var integerGuessed = numberGuessed.text
if numberString == integerGuessed {
self.answer.text = "You're right! I had \(integerGuessed) fingers up"
}else {
self.answer.text = "Nope! I had \(numberString) fingers up"
}
}
It is a very small project so this is the entire code. The button guessMade
is supposed to check to see if the number entered in the text field matches the randomly generated number also produced when the button is pressed. Any ideas what the error is telling me wrong?