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

Michael Murray
6,037 PointsHELP! I have a CRASH at Updating Quantity of the Vending Machine App
My code and the error I get:
@IBAction func updateQuantity(sender: UIStepper) { print(sender.value) }
Thread 1: SIGABRT . Generated from the following file:
// AppDelegate.swift // VendingMachine // // Created by Pasan Premaratne on 1/19/16.
2016-08-15 17:19:21.270 VendingMachine[48597:4383104] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<VendingMachine.ViewController 0x7fda9bcb6be0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key updateQuantity.'
1 Answer

Martin Wildfeuer
Courses Plus Student 11,071 PointsThis is most commonly the result of a storyboard outlet/action connected to a property/method that is not longer there. That is, you might have removed/renamed a property/method in code that was still connected to an outlet. This is not handled automatically by Xcode, if you remove a connected property/method in code, you also have to remove that connection in storyboard.
To check for this, switch to storyboard and bring up the utilities column (upper right). Select the element and the connections inspector (top right of the utilities column). Check if there are any unwanted connections and remove them if necessary.
In your case, something (I guess a button action) was connected to updateQuantity
on your ViewController
class, but it seems to be not there anymore.
Hope that helps!

Michael Murray
6,037 PointsThank you Martin for responding. I have tried several times to remove the code and the storyboard link. Doesn't get rid of the crash. Is there an order to it - do you remove the code first, then the link (or does it matter)?
Michael Murray
6,037 PointsMichael Murray
6,037 PointsThank you Martin for responding. I have tried several times to remove the code and the storyboard link. Doesn't get rid of the crash . . .y I am thinking of starting the course from the very beginning to make sure that the unknown bug in my code or any unwanted connections are not there. How do I go about doing this?