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 trial

iOS Swift 2.0 Collections and Control Flow Dictionaries Working with Dictionaries

We've learned that while people like our chocolate chip flavor, they like it even better when it has cookie dough in it

We've learned that while people like our chocolate chip flavor, they like it even better when it has cookie dough in it as well.

Let's update the value for the key "CC", to be "Chocolate Chip Cookie Dough".

3 Answers

Hi Michael,

If you post the code you've tried so far, it can help us see the cause of the specific error you're experiencing with the Challenge. There's generally going to be more than one way to solve a Challenge, and the way you're trying could just have a typo in it; however, the most efficient way to update the value of "CC" would probably be to use the following code.

iceCream["CC"] = "Chocolate Chip Cookie Dough"

Thanks Evan, I had the answer, I was just trying to post it for someone else, I just forgot to post the code.

iceCream.updateValue("Chocolate Chip Cookie Dough", forKey: "CC")

iceCream["CC"] = "Chocolate Chip Cookie Dough"