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 Using Our JSON Data

Xcode missing the stringWithContentsOfURL?

var urlContents = ????? It doesn't come up, and when i type i manually it gives me loads of errors.

1 Answer

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

Hey Daniel Delouya

Apple updated the method to use NSString(contentsOfURL: NSURL, encoding: UInt, error: NSErrorPointer) instead. We're in the process of updating the course to account for changes to Xcode.

NSString(contentsOfURL: location, encoding: NSUTF8StringEncoding, error: nil)

Thanks Pasan!