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

Aananya Vyas
Aananya Vyas
20,157 Points

I am getting this error on the line where I declare 'let weatherData':

Build a Weather app, Making a simple network request (4th video)

Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=256 "The file “37.8267,-122.4233” couldn’t be opened." UserInfo={NSURL=37.8267,-122.4233 -- https://api.darksky.net/forecast/(darkSkyApiKey)/}
let forecastUrl = URL(string: "37.8267,-122.4233", relativeTo: base)
let weatherData = try! Data(contentsOf: forecastUrl!)
print(weatherData)

1 Answer