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 Refactoring Our Code Tapping On Our Playlists

Kris Larsen
Kris Larsen
8,015 Points

I need help, because when i press on one of the pictures in my app i get a fail

The fail looks like..

2015-11-16 14:33:58.569 Algorhythm[743:18326] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Algorhythm.PlaylistDetailViewController 0x7b6a2080> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key playlistArtists0.' *** First throw call stack: ( 0 CoreFoundation 0x002eca84 exceptionPreprocess + 180 1 libobjc.A.dylib 0x01f85e02 objc_exception_throw + 50 2 CoreFoundation 0x002ec6a1 -[NSException raise] + 17 3 Foundation 0x0073e31c -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 4 Foundation 0x006988da _NSSetUsingKeyValueSetter + 115 5 Foundation 0x0069885f -[NSObject(NSKeyValueCoding) setValue:forKey:] + 295 6 UIKit 0x00c8f845 -[UIViewController setValue:forKey:] + 85 7 Foundation 0x006cd0bd -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 384 8 UIKit 0x00f0205c -[UIRuntimeOutletConnection connect] + 132 9 libobjc.A.dylib 0x01f9a00c -[NSObject performSelector:] + 62 10 CoreFoundation 0x0021d571 -[NSArray makeObjectsPerformSelector:] + 273 11 UIKit 0x00f006f6 -[UINib instantiateWithOwner:options:] + 2102 12 UIKit 0x00c97294 -[UIViewController _loadViewFromNibNamed:bundle:] + 429 13 UIKit 0x00c97ccc -[UIViewController loadView] + 189 14 UIKit 0x00c980d8 -[UIViewController loadViewIfRequired] + 154 15 UIKit 0x00c9ebde -[UIViewController __viewWillAppear:] + 114 16 UIKit 0x00cc1d37 -[UIViewController(UIContainerViewControllerProtectedMethods) beginAppearanceTransition:animated:] + 202 17 UIKit 0x00cd4009 -[UINavigationController _startCustomTransition:] + 1389 18 UIKit 0x00ce5bf5 -[UINavigationController _startDeferredTransitionIfNeeded:] + 803 19 UIKit 0x00ce6e3b -[UINavigationController __viewWillLayoutSubviews] + 68 20 UIKit 0x00ec2193 -[UILayoutContainerView layoutSubviews] + 252 21 UIKit 0x00b97eb7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 813 22 libobjc.A.dylib 0x01f9a059 -[NSObject performSelector:withObject:] + 70 23 QuartzCore 0x04e8e80a -[CALayer layoutSublayers] + 144 24 QuartzCore 0x04e824ee _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388 25 QuartzCore 0x04e82352 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 26 QuartzCore 0x04e74e8b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317 27 QuartzCore 0x04ea8e03 _ZN2CA11Transaction6commitEv + 561 28 QuartzCore 0x04eaa674 _ZN2CA11Transaction17flush_transactionEv + 50 29 UIKit 0x00ac7f0a _UIApplicationHandleEventQueue + 8398 30 CoreFoundation 0x00206d1f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15 31 CoreFoundation 0x001fc9ab __CFRunLoopDoSources0 + 523 32 CoreFoundation 0x001fbdc8 __CFRunLoopRun + 1032 33 CoreFoundation 0x001fb706 CFRunLoopRunSpecific + 470 34 CoreFoundation 0x001fb51b CFRunLoopRunInMode + 123 35 GraphicsServices 0x04728664 GSEventRunModal + 192 36 GraphicsServices 0x047284a1 GSEventRun + 104 37 UIKit 0x00ace1eb UIApplicationMain + 160 38 Algorhythm 0x000f1b0c main + 140 39 libdyld.dylib 0x029e9a21 start + 1 40 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

1 Answer

Sam Chaudry
Sam Chaudry
25,519 Points

Chances are you have a stray outlet somewhere. Go into your code and check that each image is connected to a single IBOutlet, sometimes you can have 2 outlets to the same outlet, and when you tap the picture in this case it is causing it to crash.