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 Build a Weather App with Swift (Retired) Concurrency Writing Concurrent Networking Code

Alex Yakir
Alex Yakir
5,425 Points

Hey Guys, Do I need to unwrap forecastURL? coz it looks like I do. Even In your project files I get the same error.

Error: " did you mean to use"!" or "?" "

Chris Rosenberg
Chris Rosenberg
1,864 Points

I'm getting the exact same error!!

Denis Hancock
Denis Hancock
3,796 Points

Same error here. Value of optional type 'NSURL?' not unwrapped

Jared Watkins
Jared Watkins
10,756 Points

same here. Yocoyani answer worked.

3 Answers

I got the same error and I just unwrapped the forecastURL

let downloadTask: NSURLSessionDownloadTask = sharedSession.downloadTaskWithURL(forecastURL!, completionHandler: { (location: NSURL!, response: NSURLResponse!, error: NSError!) -> Void in println(response) })

Alex Yakir
Alex Yakir
5,425 Points

Thanks Man! Got it :)

Somewhat trivial, but if you click "Best Answer" under Yocoyani's comment, it will mark it in green text and give them some Treehouse points. :)