Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Weather App with Swift (Retired) Pulling Data From the Web Making a Network Call

Ludwing Najera
Ludwing Najera
4,596 Points

The Teacher's Notes don't seem to help... Stormy keeps crashing with a fatal error!

Stormy keeps crashing, and when I look at the Teachers Notes, they are the same as the code in stormy, but when ever i run it, i don't get Hexadecimal what-sits but an error in the console saying "fatal error: unexpectedly found nil while unwrapping an Optional value". Please help! Also, what does "unwrapping" and "optional values" mean?

4 Answers

Try checking if there's any space inside the URLs, mainly in the forecastURL constant if you copied coordinates from google maps

E.g.: Change this "37.8267, -122.423" to this "37.8267,-122.423"

This was my problem

Oliver Pinchbeck
Oliver Pinchbeck
2,732 Points

An optional value is a value that can be something, or it can be nil (no value), so for example a variable of type string would be var: String = "empty" whereas an optional string would be var: String?

You need to unwrap an optional value in order to use it, which you do with a bang operator (!) or an if let statement.

Watch these videos, as Amit explains much more clearly than me... : https://teamtreehouse.com/library/swift-functions-and-optionals/optionals/what-is-an-optional

Ludwing Najera
Ludwing Najera
4,596 Points

That's fine, but why does the app keep crashing?

Ludwing Najera
Ludwing Najera
4,596 Points

There is no optional value from what i see.

Ludwing Najera
Ludwing Najera
4,596 Points

I should probably watch the video...