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
Jason Larkin
13,970 PointsBuild a Weather App in Swift Concurrent Code
I am getting a red "stop sign" that says when I click on it that items in series must be separated by a "," but everything is. The error is on the "let downloadTask" line.
Can anyone please help to give me a clue on how to solve this?
Here is the code:
let downloadTask: NSURLSessionDownloadTaskWithURL(forecastURL, completionHandler: {(location:NSURL!,response:NSURLResopnse!, error: NSError!) -> Void in code
println(response)
2 Answers
Daniel Reedy
25,284 PointsIt looks like one of the auto complete snippets didn't expand. It should look something like this,
let downloadTask: NSURLSessionDownloadTask = sharedSession.downloadTaskWithURL(forecastURL!, completionHandler: { (location: NSURL!, response: NSURLResponse!, error: NSError!) -> Void in
println(response)
})
Vittorio Somaschini
33,371 PointsIt is pretty though to answer as I do not know at what point you are in the making of the app.
But I think this misses the actual calling of the concurrent task..
Something like " = sharedSession.downloadTaskWithURL" right after NSURLSessionDownloadTaskWithURL, but I am not 100% sure
Jason Larkin
13,970 PointsThank you Vittorio, it worked!
Jason Larkin
13,970 PointsJason Larkin
13,970 PointsEverything was correct but for the "!" after the forecastURL. Thank you Daniel!