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 trialJeanne Merle
3,390 PointsExpected ',' separator : weird error
Hi,
I'm stuck, my Xcode wants me to add extra ',' after 'location:' 'response:' and 'error:' It says : "Fix It Insert ',' "
let downloadTask: NSURLSessionDownloadTask = sharedSession.downloadTaskWithURL(forecastURL!,
completionHandler: { (
location: <#NSURL!#>,
response: <#NSURLResponse!#>,
error: <#NSError!#>) -> Void in
println(response)
})
Of course that would not make sens to have this : location:, <#NSURL!#>, response:, <#NSURLResponse!#>, error:, <#NSError!#>
and if I still do so, the message is still the same "Expected ',' separator" if I simply follow the advices, I have 2 comas after each parameter : location:,,
and the message become "Unexpected separator ',' Fix It Delete ',' " I see no solution to this problem ... Can somebody help me ? Thanks a lot
1 Answer
Jeanne Merle
3,390 PointsI have deleted the NSURL! automatically provided by XCode and typed again "NSURL!" , and did as well for the 2 other parameters and now there is no more errors. Thanks for the advice Jiri !
PS : the <# #> where automatically added when I copied-pasted my code into this message. I have not added them on my own.
Justin Thiele
2,510 PointsHad the exact same issue. Fixed now.
Shannon Coward
2,140 PointsSame Thing here!
Brice Amram
2,937 PointsAnd... same here ! Jiri a lot of thanks too from here, in Paris, FR : )
Jiri Stepanek
10,740 PointsJiri Stepanek
10,740 PointsYea xcode is doing this sometimes also with ";". Mostly I just ignore it and rework my code. I think you should delete those hashtags and <>. It worked 4 me