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

Error in code , dont know why ?

heres my code on this github project https://github.com/benhollandY0ung/Weatherly-iOS Could you check it out to see what wrong Pasan Premaratne

it says fatal: error unexpectedly found nil while unwrapping an Optional value (lldb)

on the

let weatherDictionary: NSDictionary = NSJSONSerialization.JSONObjectWithData(dataObject!, options: nil, error: nil) as NSDictionary

line

1 Answer

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

I believe it's because you're using my API key instead of replacing it with yours. Quite a few students are doing that and it ended up exceeding 1000 calls per day (which is the free tier) so I'm guessing they cut off access thereby causing your network call to fail.

Ahh silly me. Thanks so much Pasan Premaratne