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

On the quiz it wasn't accepting greeting(Tom)

the quiz was telling me there was an error when calling the function, this was my function ....

func greeting(person: String) { println("Hello (person)") } greeting(Tom)

and this was the error...

swift_lint.swift:10:10: error: use of unresolved identifier 'Tom' greeting(Tom)

Could someone explain, it must be something really obvious but i just can't get it! what have I done wrong?

1 Answer

when you defined your function, you specified greeting to be of type String. But when you called it and passed in Tom, you forgot to put it in parenthesis so it thought it was an object.

Hope that helps, keep at it, and happy coding!

OH WOW thank you ahah I knew it was something simple like quotation marks.

Thanks buddy