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 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.