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

Weather App - Exception Error

I've been following along in Xcode and I'm right at the stage before adding a refresh button. I think part of the problem is when we were connecting the interface I misspelled one of the buttons and went back and corrected it. When the error happens, Console keeps referencing the misspelled label.

2014-10-02 04:38:49.656 Stormy[35812:759401] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Stormy.ViewController 0x7fbdd2e64f50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key temeratureLabel.'

3 Answers

Whenever you rename an IBOutlet it's no longer assigned in the storyboard so your code will be attempting to reference something that no longer has a link to the view, in this case simple removing the IBOutlet line and adding it back in from the storyboard using the new variable name will fix it.

Hope that helps.

I removed it and added it again and it still doesn't work. Also after removing the IBOutlet, I tried running the simulator again and it still get the same error, just with a different label that was spelled correctly and I didn't mess with. I've downloaded the project files and have been trying to compare the lines of code and I can't see anything different.

In your view controller are all your outlets solid grey circles like in the below image? If not it means they're no longer linked to the storyboard which means you need to link to back up from the storyboard.

iOS IBOutlet Link

Yes they are all solid circles