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
Samuel Behrens
4,576 PointsFun Facts App Crashing
So when we were adding the pop of color, I accidentally named the button outlet the same thing as the action so I undid everything and fixed it but now I my app keeps crashing. This is the message that I get in the compiler: 2014-09-23 21:58:50.699 Fun Facts[11731:529133] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Fun_Facts.ViewController 0x7fa168630200> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key funFactButonColor.' *** First throw call stack: ( 0 CoreFoundation 0x000000010c8893f5 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010e3b7bb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010c889039 -[NSException raise] + 9 3 Foundation 0x000000010cca04d3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 CoreFoundation 0x000000010c7d3400 -[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x000000010d3d697d -[UINib instantiateWithOwner:options:] + 1506 6 UIKit 0x000000010d237698 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x000000010d237c88 -[UIViewController loadView] + 109 8 UIKit 0x000000010d237ef9 -[UIViewController loadViewIfRequired] + 75 9 UIKit 0x000000010d23838e -[UIViewController view] + 27 10 UIKit 0x000000010d157db9 -[UIWindow addRootViewControllerViewIfPossible] + 58 11 UIKit 0x000000010d158152 -[UIWindow _setHidden:forced:] + 276 12 UIKit 0x000000010d16465c -[UIWindow makeKeyAndVisible] + 42 13 UIKit 0x000000010d10f191 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2628 14 UIKit 0x000000010d111e5c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350 15 UIKit 0x000000010d110d22 -[UIApplication workspaceDidEndTransaction:] + 179 16 FrontBoardServices 0x000000010ff522a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16 17 CoreFoundation 0x000000010c7beabc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 18 CoreFoundation 0x000000010c7b4805 __CFRunLoopDoBlocks + 341 19 CoreFoundation 0x000000010c7b45c5 __CFRunLoopRun + 2389 20 CoreFoundation 0x000000010c7b3a06 CFRunLoopRunSpecific + 470 21 UIKit 0x000000010d110799 -[UIApplication _run] + 413 22 UIKit 0x000000010d113550 UIApplicationMain + 1282 23 Fun Facts 0x000000010c6a787e top_level_code + 78 24 Fun Facts 0x000000010c6a78ba main + 42 25 libdyld.dylib 0x000000010eb91145 start + 1 26 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
And then the screen shows this: class AppDelegate: UIResponder, UIApplicationDelegate { Thread 1: Signal SIGABRT
1 Answer
Robert Bojor
Courses Plus Student 29,439 PointsHi Samuel,
The connection you have made earlier is still there, undo won't remove the reference to your outlet/action by just hitting Cmd+Z.
This is an issue that almost anyone in the iOS development business hit at some point or another and learned their lesson. When you connect an IBOutlet or IBAction from the storyboard to your header/controller, be it Objective-C or Swift, and you undo, not all the connection is undone properly.
Go to your storyboard, click on the resource you just linked earlier and go on the connections tab inside your inspector ( last icon, top right navigation pane ). here you will see that the last connection you have made, and undoed (is that a word?) is still there. Click the remove icon for that connection and you should be fine to continue.
Samuel Behrens
4,576 PointsSamuel Behrens
4,576 PointsThat fixed it! Thanks for helping me with it!