0

I am getting this aforementioned error. I've applied the following solution from this thread and that one with no avail. Is there some module or class I'm suppose to import? Any help will be appreciated.

Github: https://github.com/joeavargas/BMI-Calc/tree/master/BMI%20Calc

Swift 3 / Xcode 8.3.3

error

Error from Console:

2017-07-06 08:20:28.252 BMI Calc[61662:12276419] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mass.' * First throw call stack: ( 0 CoreFoundation 0x000000010df6eb0b exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010b2fe141 objc_exception_throw + 48 2 CoreFoundation 0x000000010df6ea59 -[NSException raise] + 9 3 Foundation 0x000000010ae1400b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292 4 UIKit 0x000000010b96b994 -[UIViewController setValue:forKey:] + 87 5 UIKit 0x000000010bbd8a09 -[UIRuntimeOutletConnection connect] + 109 6 CoreFoundation 0x000000010df14e8d -[NSArray makeObjectsPerformSelector:] + 269 7 UIKit 0x000000010bbd73bf -[UINib instantiateWithOwner:options:] + 1856 8 UIKit 0x000000010b971fc3 -[UIViewController _loadViewFromNibNamed:bundle:] + 381 9 UIKit 0x000000010b9728d9 -[UIViewController loadView] + 177 10 UIKit 0x000000010b972c0a -[UIViewController loadViewIfRequired] + 195 11 UIKit 0x000000010b97345a -[UIViewController view] + 27 12 UIKit 0x000000010b83b98a -[UIWindow addRootViewControllerViewIfPossible] + 65 13 UIKit 0x000000010b83c070 -[UIWindow _setHidden:forced:] + 294 14 UIKit 0x000000010b84eebe -[UIWindow makeKeyAndVisible] + 42 15 UIKit 0x000000010b7c837f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346 16 UIKit 0x000000010b7ce5e4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709 17 UIKit 0x000000010b7cb7f3 -[UIApplication workspaceDidEndTransaction:] + 182 18 FrontBoardServices 0x000000010f67e5f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24 19 FrontBoardServices 0x000000010f67e46d -[FBSSerialQueue _performNext] + 186 20 FrontBoardServices 0x000000010f67e7f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45 21 CoreFoundation 0x000000010df14c01 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 22 CoreFoundation 0x000000010defa0cf __CFRunLoopDoSources0 + 527 23 CoreFoundation 0x000000010def95ff __CFRunLoopRun + 911 24 CoreFoundation 0x000000010def9016 CFRunLoopRunSpecific + 406 25 UIKit 0x000000010b7ca08f -[UIApplication _run] + 468 26 UIKit 0x000000010b7d0134 UIApplicationMain + 159 27 BMI Calc 0x000000010ad246f7 main + 55 28 libdyld.dylib 0x000000010ef0e65d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Joe Vargas
  • 65
  • 7
  • Could you please share what it says in the debug log – Pranav Wadhwa Jul 06 '17 at 13:37
  • Most likely there is a missing or dead connection in Interface Builder. – vadian Jul 06 '17 at 13:49
  • Added the error from console. Sorry for the delayed reply...I work night shifts and I just woke up a few minutes ago. – Joe Vargas Jul 06 '17 at 19:26
  • The error is `reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mass.'` When you have `Thread 1: signal SIGABRT” error` issue, you should usually search for **reason** in the console using `cmmd + F`. As for the solution to your error: see [here](https://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reason-this-class-is-not-key-v) – mfaani Jul 06 '17 at 19:27
  • 1
    Possible duplicate of [What does this mean? "'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X"](https://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reason-this-class-is-not-key-v) – mfaani Jul 06 '17 at 19:29
  • @honey I'll look into your suggestion. Something tells me the link you provided may may help a lot. It also has very good advice about using the word "String" – Joe Vargas Jul 07 '17 at 21:57

1 Answers1

0

The most significant information is

this class is not key value coding-compliant for the key mass.

  • Select the storyboard or xib file in the project navigator
  • Select the view controller
  • Open Connection Inspector (⌥⌘6)
  • Remove the connection to mass
vadian
  • 274,689
  • 30
  • 353
  • 361
  • I see two mass connections as an option to remove. I assume I remove the one that's not declared/used in the code? – Joe Vargas Jul 06 '17 at 21:35