Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBekzod Rakhmatov
7,419 PointsError
In the video 07:55 my compiler is not happy line 28 is giving an error!
self.vendingMachine = FoodVendingMachine(inventory: inventory) to change
self.vendingMachine = FoodVendingMachine(inventory: inventory) as! VendingMachine
and I changed it as shown but I can see my console is showing like Could not cast value of type 'VendingMachine.FoodVendingMachine' (0x105b5b4f0) to 'VendingMachine.VendingMachine' (0x60000007f358).
Jacob Smith
10,926 PointsJacob Smith
10,926 PointsHello Bekzod.
I believe I was having the same issue as you. What I would recommend is:
Please let me know if that worked. I'm a novice in the field but it seemed to resolve my error.
Best of luck.
Alternatively if you see one of these (blue) breakpoints in the gutter (where your line count is), you can simply drag it away for deletion.