Reputation: 13
Outlets Crash at Entry Crash Image Screenshot
I am getting an crash after I renamed my View Controller . Swift file to CalculatorViewController.swift I also tried refactoring new class name to be mirrored across all ports of entry to the app. I am getting Abort Signal Error. Please do help with this one! This is my error UPDATE: ERROR IN queue com.apple.mainthread (serial) Thread 1
Crash point in code
class AppDelegate: UIResponder, UIApplicationDelegate {
UPDATE.
2019-03-11 15:36:01.990755+0530 NDv2[4619:144763] Unknown class CalculatorViewController in Interface Builder file. 2019-03-11 15:36:02.040903+0530 NDv2[4619:144763] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key TextOutput.' * First throw call stack: ( 0 CoreFoundation 0x000000010ef3e1bb exceptionPreprocess + 331 1 libobjc.A.dylib
0x000000010cf58735 objc_exception_throw + 48 2 CoreFoundation
0x000000010ef3dd29 -[NSException raise] + 9 3 Foundation
0x000000010c983de4 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292 4 UIKitCore 0x00000001113a3292 -[UIViewController setValue:forKey:] + 87 5 UIKitCore 0x000000011163a573 -[UIRuntimeOutletConnection connect] + 109 6
CoreFoundation 0x000000010ef29cfd -[NSArray makeObjectsPerformSelector:] + 317 7 UIKitCore
0x00000001116372b9 -[UINib instantiateWithOwner:options:] + 1814 8
UIKitCore 0x00000001113aa452 -[UIViewController _loadViewFromNibNamed:bundle:] + 383 9 UIKitCore 0x00000001113aaddc -[UIViewController loadView] + 177 10 UIKitCore
0x00000001113ab0ee -[UIViewController loadViewIfRequired] + 175 11 UIKitCore 0x00000001113ab940 -[UIViewController view] + 27 12 UIKitCore 0x0000000111a02c53 -[UIWindow addRootViewControllerViewIfPossible] + 122 13 UIKitCore 0x0000000111a0336e -[UIWindow _setHidden:forced:] + 294 14 UIKitCore 0x0000000111a165c0 -[UIWindow makeKeyAndVisible] + 42 15 UIKitCore
0x00000001119c3833 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4595 16 UIKitCore 0x00000001119c8c2f -[UIApplication _runWithMainScene:transitionContext:completion:] + 1623 17 UIKitCore 0x00000001111e74e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866 18 UIKitCore 0x00000001111f029c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153 19 UIKitCore 0x00000001111e7126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233 20 UIKitCore 0x00000001111e7ae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085 21 UIKitCore
0x00000001111e5cb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795 22 UIKitCore 0x00000001111e595f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435 23 UIKitCore 0x00000001111eaa90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584 24 UIKitCore 0x00000001111eb80e _performActionsWithDelayForTransitionContext + 100 25 UIKitCore 0x00000001111ea7ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221 26 UIKitCore 0x00000001111ef93a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392 27 UIKitCore 0x00000001119c744e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515 28 UIKitCore 0x000000011156bd09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357 29 FrontBoardServices 0x000000011a0fc2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448 30 FrontBoardServices 0x000000011a107443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271 31 FrontBoardServices 0x000000011a106b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53 32 libdispatch.dylib 0x000000011047e602 _dispatch_client_callout + 8 33 libdispatch.dylib 0x0000000110481b78 _dispatch_block_invoke_direct + 301 34 FrontBoardServices 0x000000011a13bba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 30 35 FrontBoardServices 0x000000011a13b860 -[FBSSerialQueue _performNext] + 457 36 FrontBoardServices 0x000000011a13be40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45 37 CoreFoundation 0x000000010eea3721 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 38 CoreFoundation 0x000000010eea2f93 __CFRunLoopDoSources0 + 243 39 CoreFoundation 0x000000010ee9d63f __CFRunLoopRun + 1263 40 CoreFoundation
0x000000010ee9ce11 CFRunLoopRunSpecific + 625 41 GraphicsServices
0x000000011713b1dd GSEventRunModal + 62 42 UIKitCore
0x00000001119ca81d UIApplicationMain + 140 43 NDv2
0x000000010c6291c7 main + 71 44 libdyld.dylib
0x00000001104f4575 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
Upvotes: 0
Views: 2056
Reputation: 66
I solved it by setting the 'module' for 'Custom class' in Identity inspector
Upvotes: 0
Reputation: 183
The error you are getting is because you had an IBOutlet on your storyboard that doesn't exist any more on the class where it was defined, this can be because you manually changed the name of a property on your class or deleted it.
On your storyboard, select the initial view controller and check if there is a reference to an IBOutlet named TextOutput. Delete that reference and link the View again. That should fix it
Upvotes: 0
Reputation: 765
There is two ways to change the name of ViewController:
1) Ex.: class LoginViewController: UIViewController - just select the "LoginViewController", then right click -> Refactor -> Rename
This will change the name file name, class name and take care of the storyboard class name.
2) If you not able to use Method 1, then manually rename the file Name(.swift), then you have to go to the storyboard and replace the class name of the view controller. You may have issues with the outlets.
3) After that close the Xcode and then again start your project.
Upvotes: 1
Reputation: 1396
You have a textField or textView Or UILabel in your controller in storyboard,
1- Open your Storyboard
2- click the UIViewController(ViewController with new name of class you have changed)
3- remove outlet with name TextOutput
4- ReConnet if you want and you are ready to go
Upvotes: 0