Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Simple iPhone App with Swift v5 Views and View Controllers Hooking Up IBActions

Trying to give a function to button in xCode !

I'm trying to give a function to a button but after I run the app it give me this error ! Hello World! 2020-03-20 10:49:18.606171+0200 RandomApp[18214:1686275] -[RandomApp.ViewController Morefunfacts]: unrecognized selector sent to instance 0x7fb4a0c09fc0 2020-03-20 10:49:18.611187+0200 RandomApp[18214:1686275] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RandomApp.ViewController Morefunfacts]: unrecognized selector sent to instance 0x7fb4a0c09fc0' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23c7127e exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 UIKitCore 0x00007fff480c0f17 -[UIResponder doesNotRecognizeSelector:] + 302 4 CoreFoundation 0x00007fff23c75c4c ___forwarding_ + 1436 5 CoreFoundation 0x00007fff23c77f78 CF_forwarding_prep_0 + 120 6 UIKitCore 0x00007fff48093fff -[UIApplication sendAction:to:from:forEvent:] + 83 7 UIKitCore 0x00007fff47a6c00e -[UIControl sendAction:to:forEvent:] + 223 8 UIKitCore 0x00007fff47a6c358 -[UIControl _sendActionsForEvents:withEvent:] + 398 9 UIKitCore 0x00007fff47a6b2b7 -[UIControl touchesEnded:withEvent:] + 481 10 UIKitCore 0x00007fff480cebbf -[UIWindow _sendTouchesForEvent:] + 2604 11 UIKitCore 0x00007fff480d04c6 -[UIWindow sendEvent:] + 4596 12 UIKitCore 0x00007fff480ab53b -[UIApplication sendEvent:] + 356 13 UIKitCore 0x00007fff4812c71a __dispatchPreprocessedEventFromEventQueue + 6847 14 UIKitCore 0x00007fff4812f1e0 __handleEventQueueInternal + 5980 15 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 17 16 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76 17 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180 18 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263 19 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438 20 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65 21 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621 22 RandomApp 0x0000000105b9bb1b main + 75 23 libdyld.dylib 0x00007fff5227ec25 start + 1 24 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)