-3
@IBAction func blueBtnAct(_ sender: AnyObject) {
score++ //error bcause Unary operator '++' cannot be applied to an operand of type '@lvalue Int'
blueLbl.text = "\(score)"
GrenLbl.text = "\(score)"
testScore()
}
@IBAction func GrenBtnAct(_ sender: AnyObject) {
score-- //error bcause Unary operator '--' cannot be applied to an operand of type '@lvalue Int'
blueLbl.text = "\(score)"
GrenLbl.text = "\(score)"
testScore()
}
Le remplacement recommandé est 'partition + = 1' – vadian
oui vous êtes right @vadian mais score = score + 1 facile pour but d'apprentissage – Zee
Non, apprenez les bonnes choses. Qui est capable de comprendre «++» va comprendre «+ = 1», aussi ;-) – vadian