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 Objective-C Building the Master and Detail Views Displaying Playlist Information

Romi Stepovich
Romi Stepovich
8,473 Points

When I was linking the "Title" element to the PlaylistDetailViewController.h I made a typo when I named the @property.

I typed: playlistsTitle and discovered this after I connected the "Title" on the main storyboard page to the PlayListDetailViewController. I fixed the typo in the PlayListDetailViewController but now when I run the program, I get an error message when I try to press the button. I know that I need to go somewhere else to fix that playlists because that is what the error is showing me, but I don't understand where I need to go. I can't find it replicated anywhere else. Here is what the bug error says:

2015-07-24 15:25:23.403 Algorhythm[16415:2607945] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<PlayListDetailViewController 0x7ff0a8d6d0e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key playlistsTitle.' *** First throw call stack: ( 0 CoreFoundation 0x000000010f64bc65 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010f2e4bb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010f64b8a9 -[NSException raise] + 9 3 Foundation 0x000000010ee7ab53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 CoreFoundation 0x000000010f593d50 -[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x000000010fd1c4eb -[UINib instantiateWithOwner:options:] + 1506 6 UIKit 0x000000010fb746d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x000000010fb74cc8 -[UIViewController loadView] + 109 8 UIKit 0x000000010fb74f39 -[UIViewController loadViewIfRequired] + 75 9 UIKit 0x000000010fb753ce -[UIViewController view] + 27 10 UIKit 0x000000010fb9a257 -[UINavigationController _startCustomTransition:] + 633 11 UIKit 0x000000010fba637f -[UINavigationController _startDeferredTransitionIfNeeded:] + 386 12 UIKit 0x000000010fba6ece -[UINavigationController __viewWillLayoutSubviews] + 43 13 UIKit 0x000000010fcf16d5 -[UILayoutContainerView layoutSubviews] + 202 14 UIKit 0x000000010fac49eb -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536 15 QuartzCore 0x000000011328aed2 -[CALayer layoutSublayers] + 146 16 QuartzCore 0x000000011327f6e6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 17 QuartzCore 0x000000011327f556 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 18 QuartzCore 0x00000001131eb86e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242 19 QuartzCore 0x00000001131eca22 _ZN2CA11Transaction6commitEv + 462 20 UIKit 0x000000010fa415e6 _UIApplicationHandleEventQueue + 2140 21 CoreFoundation 0x000000010f57f431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 22 CoreFoundation 0x000000010f5752fd __CFRunLoopDoSources0 + 269 23 CoreFoundation 0x000000010f574934 __CFRunLoopRun + 868 24 CoreFoundation 0x000000010f574366 CFRunLoopRunSpecific + 470 25 GraphicsServices 0x0000000112b71a3e GSEventRunModal + 161 26 UIKit 0x000000010fa448c0 UIApplicationMain + 1282 27 Algorhythm 0x000000010edada4f main + 111 28 libdyld.dylib 0x0000000111bef145 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Romi Stepovich
Romi Stepovich
8,473 Points

What I should have typed what playlistTitle...I forgot to put that in my explantation and that is what I did type to try and fix it. What I want to know is when I do something like this, where else do I need to go in my code to fix the problem?

1 Answer

Leah Padgett
Leah Padgett
2,994 Points

I see this is old but if it helps someone else here is what I think the answer is. From the main.storyboard file you'll have to click the Title element and then under the Connections inspector remove the extra referencing outlet you created (the wrong one). Hope that helps!