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 trialAndrew Brotherton
7,515 PointsGetting error when I try and run signup screen
I'm getting the following error when I press the signup button on my app. return UIApplicationMain(argc, argv, nil, NSStringFromClass([THAppDelegate class]));
4 Answers
Stone Preston
42,016 Pointsok you most likely added your emailTextField to the storyboard, connected it as an outlet, and then after it was connected changed the name. Here is what you need to do.
go to your header file and remove the outlet declaration of the emailTextField
then go to your storyboard file and select your view controller. then open up the outlets inspector (its the furthest button on the utilities pane that looks like an arrow with a circle around it). find the emailTextField outlet and remove it by clicking the x button.
then control click and drag from the emailtextfield in your storyboard to the header file. name it whatever name you used to reference it in your code (emailTextField most likely)
Stone Preston
42,016 Pointsyou will need to post the actual error information thats in the debug console. there is a log section at the bottom right of the debug console that should have some errror information in it. you may have to scroll down to find it. post what you find
Andrew Brotherton
7,515 Points2014-09-07 21:41:44.018 Ribbit[71496:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SignupViewController 0xac639d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key emailaddressField.' *** First throw call stack: ( 0 CoreFoundation 0x027601e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x024df8e5 objc_exception_throw + 44 2 CoreFoundation 0x027effe1 -[NSException raise] + 17 3 Foundation 0x0219fd9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282 4 Foundation 0x0210c1d7 _NSSetUsingKeyValueSetter + 88 5 Foundation 0x0210b731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267 6 Foundation 0x0216db0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412 7 UIKit 0x014561f4 -[UIRuntimeOutletConnection connect] + 106 8 libobjc.A.dylib 0x024f17de -[NSObject performSelector:] + 62 9 CoreFoundation 0x0275b76a -[NSArray makeObjectsPerformSelector:] + 314 10 UIKit 0x01454d4d -[UINib instantiateWithOwner:options:] + 1417 11 UIKit 0x012bd6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280 12 UIKit 0x012bde9d -[UIViewController loadView] + 302 13 UIKit 0x012be0d3 -[UIViewController loadViewIfRequired] + 78 14 UIKit 0x012be5d9 -[UIViewController view] + 35 15 UIKit 0x012d8942 -[UINavigationController _startCustomTransition:] + 778 16 UIKit 0x012e58f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688 17 UIKit 0x012e64e9 -[UINavigationController __viewWillLayoutSubviews] + 57 18 UIKit 0x014270d1 -[UILayoutContainerView layoutSubviews] + 213 19 UIKit 0x0120e964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355 20 libobjc.A.dylib 0x024f182b -[NSObject performSelector:withObject:] + 70 21 QuartzCore 0x005ce45a -[CALayer layoutSublayers] + 148 22 QuartzCore 0x005c2244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380 23 QuartzCore 0x005c20b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 24 QuartzCore 0x005287fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294 25 QuartzCore 0x00529b85 _ZN2CA11Transaction6commitEv + 393 26 QuartzCore 0x005e75b0 +[CATransaction flush] + 52 27 UIKit 0x0119d9bb _UIApplicationHandleEventQueue + 13095 28 CoreFoundation 0x026e977f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15 29 CoreFoundation 0x026e910b __CFRunLoopDoSources0 + 235 30 CoreFoundation 0x027061ae __CFRunLoopRun + 910 31 CoreFoundation 0x027059d3 CFRunLoopRunSpecific + 467 32 CoreFoundation 0x027057eb CFRunLoopRunInMode + 123 33 GraphicsServices 0x043445ee GSEventRunModal + 192 34 GraphicsServices 0x0434442b GSEventRun + 104 35 UIKit 0x0119ff9b UIApplicationMain + 1225 36 Ribbit 0x00002c3d main + 141 37 libdyld.dylib 0x02ffd701 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
Andrew Brotherton
7,515 PointsGot it, did exactly what you said and disconnected all of the connections from the emailfield and re-connected it using a different name and it worked.
Stone Preston
42,016 Pointscool yeah once you add it as an outlet if you want to change the name you just have to remove the outlet and add it again. changing the name after its been added is probably the most common source of the "this class is not key value coding compliant" type error