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
Tyler Amend
2,236 PointsSyntax and Parameters challenge "Unresolved Identifier"
Hi All,
I'm trying to complete the challenge and run into issues on the third attempt. When I try and pass a parameter to the function I get the error "Unresolved Identifier." As far as I can see it is exactly the same as it was in the lesson. I replicated the issue in Xcode so something is apparently wrong with my code. See below what I have.
func greeting(person: String) {
println("Hello \(person)")
}
greeting(Tom)
The issue occurs when calling the function.
Thanks for your help!
1 Answer
boruch woolstone
1,192 Pointswhen you call your greeting function you need to provide a String. you function call should read: greeting("Tom") not greeting(Tom). the quotes indicate to the compiler that Tom is a string not a variable name
Tyler Amend
2,236 PointsTyler Amend
2,236 PointsFigured it out. Thanks anyway!