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 Simple iPhone App with Swift Views and View Controllers View Controllers and IBAction

roberth3
roberth3
3,940 Points

Problem

Okay, when I run this app I get this error in console: http://pastebin.com/vXpdQDk4

Here is the viewcontroller file: http://pastebin.com/G8sxDNP0

2 Answers

Martin Wildfeuer
PLUS
Martin Wildfeuer
Courses Plus Student 11,071 Points

I am just guessing here, but let's give it a try:

Have you removed a function that was connected via Interface Builder before or vice versa? Is everything connected correctly? Select your button in the storyboard, open the utility view (it is the right column) and select the connections inspector (circled arrow in the upper right). Are there any connections that should not be there? If yes, remove them by clicking the little x.

Another thing that I noticed is that your action might be missing the parameter sender: UIButton button, not sure if that would trigger a runtime exception, though...

roberth3
roberth3
3,940 Points

You were right.

Adrien Yvon
Adrien Yvon
3,079 Points

Hi I had the same issue, lot of error code. Thank to you, it worked, there was 2 connections on the button !!