Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Object-Oriented Swift Value vs Reference Types Final Challenge

Tyler Proctor
Tyler Proctor
11,458 Points

The compiler keeps telling me that I can't assign a new value to a "let" even though I have changed them to "var"

I know that this code is not completed yet and there are still things I need to adjust in the init methods at the bottom, but one persistent issue is with the values "wheels" and "doors" in the Vehicle class. In the original code they start as "let" and even though i have changed them to "var" the compiler still keeps telling me that it cannot assign a new value to a "let." Am I missing something?

Martin Wildfeuer
Martin Wildfeuer
Courses Plus Student 11,071 Points

Hey Tyler, please attach your code to the question so we can have a closer look at it. Thanks!

2 Answers

Justin Reed
seal-mask
.a{fill-rule:evenodd;}techdegree
Justin Reed
Full Stack JavaScript Techdegree Student 33,458 Points

Try saving, closing and restarting. Every once in a while something seems to jam in the system and this releases it.

Hope this helps, would love an upvote if you could, almost done with the whole course, just need these darn community points.

Kind regards,

Justin

Tyler Proctor
Tyler Proctor
11,458 Points

I appreciate both of your responses. I did manage to solve this after looking at some similar examples.