War card game tutorial - "Value of type 'UIStackView?' has no member 'text'

I’m just following Chris’ youtube tutorial and when I type in this code -

‘’’
if leftNumber > rightNumber {
print(“Left side wins”)
leftScore += 1
leftScoreLabel.text = String(leftScore)
}
else if leftNumber < rightNumber {
print(“Right side wins”)
rightScore += 1
rightScoreLabel.text = String(rightScore)
}
‘’’

  • I get an error saying that “Value of type ‘UIStackView?’ has no member ‘text’”

Any ideas on what I am doing wrong? I went through line for line and couldn’t figure it out. Thanks!

Hi Rashon,

Have you connected all the Label UI elements to the ViewController correctly?

Can you provide a screen capture of the IBOutlets you have configured.

You might need to go back over the video again and check that you have not missed anything.

Ohh okay I figured it out thank you! Apparently I connected the variables to the stackview rather than the label inside the stack view.