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

Signing Up New Users Part 1 - UIAlertView ... Sign Up button crashes the stimulator.

Could anyone help me fix this issue. When I run the stimulator and press the sign up button in the login view controller, the app crashes.

This is the output: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SignupViewController 0x9a9fbd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key userNameField.' *** First throw call stack: ( 0 CoreFoundation 0x026381e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x023b78e5 objc_exception_throw + 44 2 CoreFoundation 0x026c7fe1 -[NSException raise] + 17 3 Foundation 0x02077d9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 4 Foundation 0x01fe41d7 _NSSetUsingKeyValueSetter + 88 5 Foundation 0x01fe3731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 6 Foundation 0x02045b0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 7 UIKit 0x0132e1f4 -[UIRuntimeOutletConnection connect] + 106 8 libobjc.A.dylib 0x023c97de -[NSObject performSelector:] + 62 9 CoreFoundation 0x0263376a -[NSArray makeObjectsPerformSelector:] + 314 10 UIKit 0x0132cd4d -[UINib instantiateWithOwner:options:] + 1417 11 UIKit 0x011956f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 12 UIKit 0x01195e9d -[UIViewController loadView] + 302 13 UIKit 0x011960d3 -[UIViewController loadViewIfRequired] + 78 14 UIKit 0x011965d9 -[UIViewController view] + 35 15 UIKit 0x011b0942 -[UINavigationController _startCustomTransition:] + 778 16 UIKit 0x011bd8f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688 17 UIKit 0x011be4e9 -[UINavigationController __viewWillLayoutSubviews] + 57 18 UIKit 0x012ff0d1 -[UILayoutContainerView layoutSubviews] + 213 19 UIKit 0x010e6964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355 20 libobjc.A.dylib 0x023c982b -[NSObject performSelector:withObject:] + 70 21 QuartzCore 0x00bf045a -[CALayer layoutSublayers] + 148 22 QuartzCore 0x00be4244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 23 QuartzCore 0x00be40b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 24 QuartzCore 0x00b4a7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 25 QuartzCore 0x00b4bb85 _ZN2CA11Transaction6commitEv + 393 26 QuartzCore 0x00c095b0 +[CATransaction flush] + 52 27 UIKit 0x010759bb _UIApplicationHandleEventQueue + 13095 28 CoreFoundation 0x025c177f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15 29 CoreFoundation 0x025c110b __CFRunLoopDoSources0 + 235 30 CoreFoundation 0x025de1ae __CFRunLoopRun + 910 31 CoreFoundation 0x025dd9d3 CFRunLoopRunSpecific + 467 32 CoreFoundation 0x025dd7eb CFRunLoopRunInMode + 123 33 GraphicsServices 0x036ba5ee GSEventRunModal + 192 34 GraphicsServices 0x036ba42b GSEventRun + 104 35 UIKit 0x01077f9b UIApplicationMain + 1225 36 Ribbit 0x00002a0d main + 141 37 libdyld.dylib 0x02eb8701 start + 1 38 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type

Would greatly appreciate any help I could receive.

3 Answers

Stone Preston
Stone Preston
42,016 Points

You probably added an outlet to your storyboard then renamed it without properly removing the old connection. In your storyboard, select your view controller, select the outlets inspector, then check and make see if you have any outlets connected with a warning sign next to them. If you have one with a warning sign, delete it by clicking the X. In your case its probably the userName textfield thats been renamed to something else.

Patrick Donahue
Patrick Donahue
9,523 Points

Good point! I haven't done that one in a long time.

Thanks guys! I had to properly remove an old connection! Now is when I remembered that I had mistyped it and made a new one. Once again, thank you for saving me some time!!

Patrick Donahue
Patrick Donahue
9,523 Points
[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key userNameField.

Looks like your userNameField isn't passing information. Check that it is hooked up in the storyboard. If that isn't it can you paste your signUp method?

Trevor Gerzen
Trevor Gerzen
2,749 Points

Stimulator has to be one of my favorite typos in all of coding typos ever