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 Simple Data Structures Loading Files From A Directory

I'm getting a 'String?' not unwrapped error. I'm not sure how to fix this.

I think the issue is in optionals. I unwrapped an optional at the end, so I do know what's wrong. Do I have to incorporate an if-let statement?

plist.swift
import Foundation

// Add your code below
let plistPath = NSBundle.mainBundle().pathForResource( "CrazyInformation.plist", ofType:"plist")
let dictionary = NSDictionary(contentsOfFile: plistPath!)
Enrique Munguía
Enrique Munguía
14,311 Points

Your code should compile without problems, is this a challenge or xcode gives the error?

Yeah, it's a challenge, but it keeps telling me it has a String not unwrapped error.