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

Im stuck on one of the task. Call the greeting function and pass it the String "Jerry"

i cant seem to get it!!

Call the greeting function and pass it the String "Jerry"

my code:

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

this is part 2 of the parameters and tuples

solved!! apperently you have to put

greeting (person: "Jerry")

when trying to pass a string into the function

1 Answer

the function greeting is waiting a named parameter called "person", while when calling it you are not supporting that namedparam. send you namedparam and it should be fixed, like so:

func greeting(#person: String) {
// code here
}

greeting(person: "Jerry")

Yeah i went back and read the teachers notes. and it made sense finally. it was driving me crazy. makes sense since your trying to put the string into the parameter "person".

thanks lulu!