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 Playlist Browser with Swift Working With Multiple View Controllers Recap of iOS Basics

App crushes with error: "uncaught exception 'NSUnknownKeyException'"

Error: 2016-01-24 14:52:14.902 Algorhythm[38306:967997] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Algorhythm.ViewController 0x7fc3b3413290> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key a.' *** First throw call stack: ( 0 CoreFoundation 0x000000010d3c8e65 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010f108deb objc_exception_throw + 48 2 CoreFoundation 0x000000010d3c8aa9 -[NSException raise] + 9 3 Foundation 0x000000010d7919bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288 4 UIKit 0x000000010dd74320 -[UIViewController setValue:forKey:] + 88 5 UIKit 0x000000010dfa2f41 -[UIRuntimeOutletConnection connect] + 109 6 CoreFoundation 0x000000010d3094a0 -[NSArray makeObjectsPerformSelector:] + 224 7 UIKit 0x000000010dfa1924 -[UINib instantiateWithOwner:options:] + 1864 8 UIKit 0x000000010dd7aeea -[UIViewController _loadViewFromNibNamed:bundle:] + 381 9 UIKit 0x000000010dd7b816 -[UIViewController loadView] + 178 10 UIKit 0x000000010dd7bb74 -[UIViewController loadViewIfRequired] + 138 11 UIKit 0x000000010dd7c2e7 -[UIViewController view] + 27 12 UIKit 0x000000010dc52ab0 -[UIWindow addRootViewControllerViewIfPossible] + 61 13 UIKit 0x000000010dc53199 -[UIWindow _setHidden:forced:] + 282 14 UIKit 0x000000010dc64c2e -[UIWindow makeKeyAndVisible] + 42 15 UIKit 0x000000010dbdd663 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131 16 UIKit 0x000000010dbe3cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760 17 UIKit 0x000000010dbe0e7b -[UIApplication workspaceDidEndTransaction:] + 188 18 FrontBoardServices 0x0000000110f9d754 -[FBSSerialQueue _performNext] + 192 19 FrontBoardServices 0x0000000110f9dac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45 20 CoreFoundation 0x000000010d2f4a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 21 CoreFoundation 0x000000010d2ea95c __CFRunLoopDoSources0 + 556 22 CoreFoundation 0x000000010d2e9e13 __CFRunLoopRun + 867 23 CoreFoundation 0x000000010d2e9828 CFRunLoopRunSpecific + 488 24 UIKit 0x000000010dbe07cd -[UIApplication _run] + 402 25 UIKit 0x000000010dbe5610 UIApplicationMain + 171 26 Algorhythm 0x000000010d1ea50d main + 109 27 libdyld.dylib 0x000000010fc1192d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Crushes when running the app for the first time after creating aButton. Error in AppDelegate.swift, line #12: "class AppDelegate: UIResponder, UIApplicationDelegate {", saying "Thread 1: signal SIGABRT"

Working with Xcode 7.2 and iOS 9.2 in app settings.

1 Answer

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

This is most commonly the result of a storyboard outlet connected to a class property that is not longer there. That is, you might have removed/renamed a property in code that was still connected to an outlet. This is not handled automatically by Xcode, if you remove a connected property in code, you also have to remove that connection in storyboard.

To check for this, switch to storyboard and bring up the utilities column (upper right). Select the element and the connections inspector (top right of the utilities column). Check if there are any unwanted connections and remove them if necessary.

Hope that helps!

It works. Thank you!!