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

Swift Weather App: Problem Extracting JSON Response to NSString

Following videos and everything is working up to this point. I receive the response from forecast.io and can write the JSON out to the console.

When I introduce the call to stringWithContentsOfURL, I get fatal errors.

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

                var urlContents = NSString.stringWithContentsOfURL
                (location, encoding: NSUTF8StringEncoding, error: nil)

   })

The specific error is...

Could not find an overload for 'stringWithContentsOfURL' that accepts the supplied parameters

Answered my own issue. It was an accidental carriage return between the method name and the open parenthesis. Never a good thing.

Answered my own issue. It was an accidental carriage return between the method name and the open parenthesis. Never a good thing.