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
Lewis Potter
4,442 PointsiOS Weather APP project files broken
It seems that XCode has been updated since the release of this guide. As a result, the provided project files for this part of the course all fail to build. Does anyone have a fix for this, as I've tried and failed.
The error seems to reside in this block of code:
let downloadTask: NSURLSessionDownloadTask = sharedSession.downloadTaskWithURL(forecastURL, completionHandler: { (location: NSURL!, response: NSURLResponse!, error: NSError!) -> Void in
if (error == nil) {
let dataObject = NSData(contentsOfURL: location)
let weatherDictionary: NSDictionary = NSJSONSerialization.JSONObjectWithData(dataObject, options: nil, error: nil) as NSDictionary
I get the error "Value of NSURL? not unwrapped, did you mean to use ! or ?"
Any help would be appreciated and obviously the treehouse guys need to fix the project files as the update was quite a while back now.
Cheers
Lewis