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 2.0 View Controllers and Views Using IBAction to Execute Methods

Error. In control log

I think i do exactly what teacher said. I try to redo it again. It displayed error as below Please tell me what I did wrong

You pressed me 2016-05-14 01:41:22.148 FunFact[8915:142982] -[FunFact.ViewController showFunFact:]: unrecognized selector sent to instance 0x7fe70158d8e0 2016-05-14 01:41:22.195 FunFact[8915:142982] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FunFact.ViewController showFunFact:]: unrecognized selector sent to instance 0x7fe70158d8e0' *** First throw call stack: ( 0 CoreFoundation 0x0000000105b59d85 exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001078fddeb objc_exception_throw + 48 2 CoreFoundation 0x0000000105b62d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x0000000105aa8cfa ___forwarding_ + 970 4 CoreFoundation 0x0000000105aa88a8 CF_forwarding_prep_0 + 120 5 UIKit 0x0000000106383a8d -[UIApplication sendAction:to:from:forEvent:] + 92 6 UIKit 0x00000001064f6e67 -[UIControl sendAction:to:forEvent:] + 67 7 UIKit 0x00000001064f7143 -[UIControl _sendActionsForEvents:withEvent:] + 327 8 UIKit 0x00000001064f6263 -[UIControl touchesEnded:withEvent:] + 601 9 UIKit 0x00000001063f699f -[UIWindow _sendTouchesForEvent:] + 835 10 UIKit 0x00000001063f76d4 -[UIWindow sendEvent:] + 865 11 UIKit 0x00000001063a2dc6 -[UIApplication sendEvent:] + 263 12 UIKit 0x000000010637c553 _UIApplicationHandleEventQueue + 6660 13 CoreFoundation 0x0000000105a7f301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17 14 CoreFoundation 0x0000000105a7522c __CFRunLoopDoSources0 + 556 15 CoreFoundation 0x0000000105a746e3 __CFRunLoopRun + 867 16 CoreFoundation 0x0000000105a740f8 CFRunLoopRunSpecific + 488 17 GraphicsServices 0x000000010a1efad2 GSEventRunModal + 161 18 UIKit 0x0000000106381f09 UIApplicationMain + 171 19 FunFact 0x00000001059754c2 main + 114 20 libdyld.dylib 0x00000001083c192d start + 1 21 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

1 Answer

Bruno Bandeira de Azevedo
Bruno Bandeira de Azevedo
25,374 Points

Supawong,

I had a similar error, I had linked the button to the method showFunFact twice, so I unlinked everything and linked again.

You can check it opening the Storyboard and command-clicking on the button, next to the Touch up inside it should read to the right showFunFact only one time.

Thank you very much for your help