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 Refreshing the Data The End

Unknown Key Exception error

My app crashes with an unknown key exception on the refreshWeather function. This error occurs on the AppDelegate controller:

2016-05-06 07:16:41.400 Stormy[970:38861] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Stormy.ViewController 0x7fa942e868e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key refreshWeather.'

1 Answer

Found the problem: I had accidentally added the button as a UIOutlet at one point, and deleted it in the code without taking it off the button itself in storyboard.