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 trialDaniel Hepting
1,803 PointsGetting a fatal Error on "precibProbability = currentWeather..."
I get an error on that line:
precibProbability = currentWeather ["precibProbability"] as Double
Error description: fatal error: unexpectedly found nil while unwrapping an Optional value (lldb)
I already tried to debug, didn't work, please help
Daniel Hepting
1,803 PointsThanks! That one space wasn't the fault, but after I rechecked my code four times, I finally found my mistake.
1 Answer
Becool Man
Courses Plus Student 649 PointsHow about posting a solution?
Olga Belova
1,482 PointsOlga Belova
1,482 PointsDaniel, hi.
I just caught the same error.
I re-cheked all variables names in struct Current and found few misspells. To get right names I printed out weatherDictionary and compared actual data with my var names. After I fixed misspells all works fine.
As I can see, you have just the same problem. It should be:
precipProbability = currentWeather["precipProbability"] as Double
Hope it will help.