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
David Galindo
Courses Plus Student 2,294 Pointsbuilding a weather App
After doing all the things that we did in the video from "Adding a Refresh Button" when i run my code a get a "terminating with uncaught exception of type NSException" in my console. Don't know what I did wrong??
David Galindo
Courses Plus Student 2,294 PointsAnother Note when i try to debug it it won't pass the AppDelegate file
2 Answers
Stone Preston
42,016 Pointsok go to your view controller (the code) and remove the outlet for your refreshActivityIndicator. just delete this line of code.
@IBOutlet weak var refreshActivityIndicator: UIActivityIndicatorView!
then go to your storyboard file. click on the view controller and open up the connections inspector (its in the utlities pane, its the button that looks like a circle with an arrow in it). delete the connection for the activityIndicator. then open the assistant editor. control click and drag from the activityIndicator on your storyboard to the file to connect them again
what happened was you connected the acitivity indicator and named it. then you changed the name and this caused the connection to the storyboard to mess up and you get this error
David Galindo
Courses Plus Student 2,294 Pointsyes thats true thanks I got it to work now i just have figured out why my refresh button does not show when i run my app. but thank you again
Stone Preston
42,016 Pointswhat does the console say about the exception. if you scroll down it should say exactly whats causing the exception to be thrown
David Galindo
Courses Plus Student 2,294 PointsThis correct??
2014-12-02 16:41:34.852 Stormy[895:25774] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Stormy.ViewController 0x7f8449964ed0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key refreshActivityIndicatior.'
David Galindo
Courses Plus Student 2,294 PointsDavid Galindo
Courses Plus Student 2,294 Pointsimport UIKit
class ViewController: UIViewController { private let apiKey = "7919218f8bf1fbe2a815b1606da1535b"
}