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 trialAananya Vyas
20,157 PointsI 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
Gavin Butler
iOS Development with Swift Techdegree Graduate 15,489 PointsPlease disregard - fixed by resetting API key on Dark Sky site.
Gavin Butler
iOS Development with Swift Techdegree Graduate 15,489 PointsGavin Butler
iOS Development with Swift Techdegree Graduate 15,489 PointsI am getting the exact same error and see that no-one has responded to this query. Could someone please respond?