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
anthonypaulino2
2,068 PointsKeep scrolling
Doesnt let me delete this question so hi
2 Answers
Steve Hunter
57,712 PointsFormatted! You'd done that right but got the word swift slightly wrong.
Anyway, you're defining coinArray inside coinInfo. So at the point you call the method and pass it the parameter, coinArray it doesn't exist.
Is this a code challenge? If so, can you post the link?
Cheers,
Steve.
Steve Hunter
57,712 PointsAs you're returning a String try adding <String> after each dictionary index variable. You need to declare the type that will be returned as a dictionary can hold anything. I suspect that'll cause further problems, though.
I'm not clear on what the requirements are for this piece of code, though, so I'm not sure how best to advise you. What is it that the code should achieve? What's the question/problem to solve?
Steve.
anthonypaulino2
2,068 PointsI was originally going to do this extra credit:
Write a function that accepts a Dictionary as parameter and returns a named tuple. The dictionary should contain the following keys: title, artist and album.
But i decided to do coins for some reason.
anthonypaulino2
2,068 PointsAnd the language is Swift
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsA quick search got me this thread - that might help you?
Steve.
anthonypaulino2
2,068 Pointsanthonypaulino2
2,068 PointsIt still gives me an error saying "Reference to generic type 'Dictionary Index' requires argument in <...>