0

私はXcode7で何度も試しましたが、それでも以下のように問題に従います:

TapWar[10487:391936] *** Terminating app due to uncaught exception 'NSUnknownKeyException', 
reason: '[<TapWar.ViewController 0x7f9848483220> setValue:forUndefinedKey:]: 
this class is not key value coding-compliant for the key buttomButtonAction.'

コードは特別なものではなく、ストーリーボード インポート UIKit のアウトレットとアクションだけです。

class ViewController: UIViewController {


    @IBOutlet weak var topButton: UIButton!
    @IBOutlet weak var buttomButton: UIButton!
    @IBOutlet weak var topLabel: UILabel!
    @IBOutlet weak var buttomLabel: UILabel!


    override func viewDidLoad() {
        super.viewDidLoad()
    score = 0

    topLabel.text = "\(score)"
    buttomLabel.text = "\(score)"

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
//Button on top to tap
    @IBAction func topButtonAction(sender: UIButton) 

    }
//Button under to tap
    @IBAction func buttomButtonAction(sender: AnyObject) {

    }
}
4

1 に答える 1

0

IBOutlet または IBAction の接続を確認しましたか? このエラーは通常、名前の不一致を引き起こします。

于 2016-02-10T01:22:21.340 に答える