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) Pulling Data From the Web Fetching JSON Data

Matt Osborn
Matt Osborn
1,042 Points

Advising incorrect answer?

Response keeps asking me to correct it saying I need to set variable courseData to the NSData but I believe the above is correct.

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Matt Osborn,

Please can you link your code into a comment here?

Refer to the markdown cheatsheet if you need any help posting your code

Matt Osborn
Matt Osborn
1,042 Points

import Foundation let treehouseBaseURL = NSURL(string: "https://api.teamtreehouse.com/") let courseURL = NSURL(string: "/course/(courseID)", relativeToURL: treehouseBaseURL) let courseData = NSData.dataWithContentsOfURL(courseURL, options: nil, error: nil)

Martin Luckett
Martin Luckett
32,591 Points

Matt

I haven't looked a the challenge again but I think the format of your answer should be something like:

let variable = NSData(contentsOfURL: [URL variable])

Florian Briou
Florian Briou
2,190 Points

Hello Matt,

Did you manage to get an answer ? Because I have the same problem.

I will be grateful if you can send me this information