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 Vending Machine App in Swift 2.0 Using the Vending Machine Updating the Price

SIGABRT Error

I was following the instructions, but when running the app, I get SIGABRT Thread 1 error.

5 Answers

Ravindu Kandana
Ravindu Kandana
5,391 Points

This is most likely due to an error in linking one of ur IBOutlets. Make sure every outlet/delegate is properly hooked up! Delete any source that isn't being used.

Austin Blaser
Austin Blaser
4,266 Points

I had the same problem anytime I clicked the Purchase button, even with its IBOutlet deleted. While I don't know why the error occurs, this fixed it for me:

Delete the IBOutlet tied to the purchase button, and close Xcode. Delete the Main.storyboard file from your working directory, and replace it with the original from the VendingMachineStarterFiles provided in the teachers note (the zipped file we all started with). Relaunch the project. Reconnect the Purchase button IBOutlet as directed.

Potsawee Manakul
Potsawee Manakul
6,332 Points

Hi,

The problem is that you deleted the code (e.g.@IBAction) that links the purchase button to ViewController, but you haven't deleted the connection of this in the MainStoryboard yet. To solve this, go to MainStoryboard click the purchase button and on the right you may see more than one link which is the problem, so you need to delete unwanted link in the view controller. alt text

Jack Vandergriff
Jack Vandergriff
1,381 Points

I found that what caused the error for me was creating an out let with the sender argument and then deleting the sender argument, so there was a mismatch between the storyboard and the view controller.