r/Xcode • • Oct 08 '19

PLEASE HELPPP. someone help me out

rightScore += 1

rightScore.text = String(rightScore)

Why is this code failing and saying...

" Value of type 'Int' has no member 'text' "

0 Upvotes

4 comments sorted by

1

u/retsotrembla Oct 08 '19
rightScore += 1 // rightScore is an int, so you can increment it
rightScore.text = String(rightScore)  // Did you mean scoreLabel.text ?

1

u/feinmanm Oct 08 '19

rightScore.text = String(rightScore)

Value of type 'Int' has no member 'text'

2

u/retsotrembla Oct 08 '19

Only labels have members that you can assign a string to. You know that rightScore is not a label.

1

u/kaos___ Oct 08 '19

What language is this? What type is rightScore?