xcode iOS App Crashes after the renaming of view controller - ios

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

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.

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

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

I solved it by setting the 'module' for 'Custom class' in Identity inspector

Related

iOS app crashing on startup when there is no network connection

As the title says, my app immediately crashes when run if there is no internet connection/airplane mode is on. The thing is, when I set breakpoints it doesn't even make it to any of my code. Not a single viewDidLoad or even AppDelegate function gets called, and the error message doesn't seem like something that would be related to not having a network connection:
2019-03-21 10:30:20.193955-0500 AppName[98957:977030] *** Terminating
app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle: 'NSBundle
<bundleFilePath> (loaded)' with name
'BYZ-38-t0r-view-8bC-Xf-vdC''
(I obviously inserted some fake values into their for privacy)
Call stack:
*** First throw call stack:
(
0 CoreFoundation 0x00000001036cb1bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000102c69735 objc_exception_throw + 48
2 CoreFoundation 0x00000001036cb015 +[NSException raise:format:] + 197
3 UIKitCore 0x00000001088edd94 -[UINib instantiateWithOwner:options:] + 497
4 UIKitCore 0x0000000108661452 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
5 UIKitCore 0x0000000108661ddc -[UIViewController loadView] + 177
6 UIKitCore 0x00000001086620ee -[UIViewController loadViewIfRequired] + 175
7 UIKitCore 0x0000000108662940 -[UIViewController view] + 27
8 UIKitCore 0x000000010858134c -[UIPresentationController __sizeClassPair] + 62
9 UIKitCore 0x0000000108675428 -[UIViewController _presentViewController:withAnimationController:completion:] + 2300
10 UIKitCore 0x000000010867874b __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 99
11 UIKitCore 0x0000000108678dd9 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 511
12 UIKitCore 0x00000001086786b1 -[UIViewController _presentViewController:animated:completion:] + 173
13 UIKitCore 0x00000001086789f0 -[UIViewController presentViewController:animated:completion:] + 150
14 AppName 0x0000000100f1125e $SSo16UIViewControllerC12DataScoutProE27showDismissiveAlertMesssage7messageySS_tF + 254
15 AppName 0x0000000100e58a97 $S12AppName18HomeViewControllerC10commonInit33_90D4AB13D5DB6EAFA2D0742F81F552BALLyyF + 727
16 AppName 0x0000000100e58462 $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfc + 146
17 AppName 0x0000000100e584df $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfcTo + 47
18 UIKitCore 0x00000001088ec166 -[UIClassSwapper initWithCoder:] + 246
19 UIFoundation 0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
20 UIFoundation 0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
21 UIKitCore 0x00000001088f07b8 -[UIRuntimeConnection initWithCoder:] + 178
22 UIFoundation 0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
23 UIFoundation 0x000000010c8f3854 UINibDecoderDecodeObjectForValue + 1428
24 UIFoundation 0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
25 UIKitCore 0x00000001088ee067 -[UINib instantiateWithOwner:options:] + 1220
26 UIKitCore 0x0000000108e228b6 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
27 UIKitCore 0x0000000108c8103a -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 112
28 UIKitCore 0x0000000108c8150c -[UIApplication _loadMainInterfaceFile] + 272
29 UIKitCore 0x0000000108c7fb25 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1357
30 UIKitCore 0x000000010849e4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
31 UIKitCore 0x00000001084a729c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
32 UIKitCore 0x000000010849e126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
33 UIKitCore 0x000000010849eae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
34 UIKitCore 0x000000010849ccb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
35 UIKitCore 0x000000010849c95f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
36 UIKitCore 0x00000001084a1a90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
37 UIKitCore 0x00000001084a280e _performActionsWithDelayForTransitionContext + 100
38 UIKitCore 0x00000001084a17ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
39 UIKitCore 0x00000001084a693a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
40 UIKitCore 0x0000000108c7e44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
41 UIKitCore 0x0000000108822d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
42 FrontBoardServices 0x000000010f55e2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
43 FrontBoardServices 0x000000010f569443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
44 FrontBoardServices 0x000000010f568b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
45 libdispatch.dylib 0x000000010548a602 _dispatch_client_callout + 8
46 libdispatch.dylib 0x000000010548db78 _dispatch_block_invoke_direct + 301
47 FrontBoardServices 0x000000010f59dba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
48 FrontBoardServices 0x000000010f59d860 -[FBSSerialQueue _performNext] + 457
49 FrontBoardServices 0x000000010f59de40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
50 CoreFoundation 0x0000000103630721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
51 CoreFoundation 0x000000010362ff93 __CFRunLoopDoSources0 + 243
52 CoreFoundation 0x000000010362a63f __CFRunLoopRun + 1263
53 CoreFoundation 0x0000000103629e11 CFRunLoopRunSpecific + 625
54 GraphicsServices 0x000000010c5b71dd GSEventRunModal + 62
55 UIKitCore 0x0000000108c8181d UIApplicationMain + 140
56 AppName 0x0000000100e8e794 main + 68
57 libdyld.dylib 0x0000000105500575 start + 1
)
I really have no clue what it could be. Tried setting a symbolic breakpoint at [UIViewController _loadViewFromNibNamed:bundle:] but that didn't really give any useful insight. Hope someone can help. I should also mention the only thing I'm doing in AppDelegate is instantiating firebase.
Helpful guy over at reddit figured it out for me. Didn't realize but there was an init() function on my initial view controller that the last guy made which checked the internet connection and redirected to a different page if there wasn't one.

Simulator of Xcode Projects is blank [duplicate]

This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 4 years ago.
as mentioned above, during one of the courses I am taking, when I run my project, the simulator opens the app, which appears to be blank.
I already reviewed many posts from people who had the same problem of mine and I tried unsuccessfully their solutions.
The solutions I reviewed are:
- Erase all content of the simulator
- Changed the type of simulator (from iPhone 8 plus to iPhone 7 plus)
- Making sure I had the right settings on the Info.plist
- Build different times the program from scratch as a new one.
And probably others I don't even remember.
I attach my files, as well as the page that opens right when my Simulator launches the application. ( the last screenshot )
Here is the error log
2018-06-18 22:52:29.685489+0200 Bullseye[2247:47563] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Bullseye.ViewController 0x7fc0df70bf90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key numValue.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010625e1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x0000000102665031 objc_exception_throw + 48
2 CoreFoundation 0x000000010625e0b9 -[NSException raise] + 9
3 Foundation 0x0000000102086b47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010309cec0 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x000000010338ae8a -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000106200e8d -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x0000000103389834 -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x00000001030a40d7 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x00000001030a4a04 -[UIViewController loadView] + 177
10 UIKit 0x00000001030a4d21 -[UIViewController loadViewIfRequired] + 175
11 UIKit 0x00000001030a5574 -[UIViewController view] + 27
12 UIKit 0x0000000102f73123 -[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKit 0x0000000102f73834 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x0000000102f865cc -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x0000000102efa3da -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4739
16 UIKit 0x0000000102eff5cb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
17 UIKit 0x00000001032c1f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
18 UIKit 0x0000000103694a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKit 0x00000001032c1bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
20 UIKit 0x00000001032c23db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
21 UIKit 0x0000000103c33614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
22 UIKit 0x0000000103c334ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
23 UIKit 0x000000010391775d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
24 UIKit 0x0000000103b124b7 _performActionsWithDelayForTransitionContext + 100
25 UIKit 0x0000000103917627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
26 UIKit 0x00000001036940e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
27 UIKit 0x0000000102efdeac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
28 UIKit 0x00000001034d0bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
29 FrontBoardServices 0x000000010828d2f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
30 FrontBoardServices 0x0000000108295cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
31 libdispatch.dylib 0x00000001073c27ec _dispatch_client_callout + 8
32 libdispatch.dylib 0x00000001073c7db8 _dispatch_block_invoke_direct + 592
33 FrontBoardServices 0x00000001082c1470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
34 FrontBoardServices 0x00000001082c112e -[FBSSerialQueue _performNext] + 439
35 FrontBoardServices 0x00000001082c168e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
36 CoreFoundation 0x0000000106200bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x00000001061e54af __CFRunLoopDoSources0 + 271
38 CoreFoundation 0x00000001061e4a6f __CFRunLoopRun + 1263
39 CoreFoundation 0x00000001061e430b CFRunLoopRunSpecific + 635
40 GraphicsServices 0x0000000108b56a73 GSEventRunModal + 62
41 UIKit 0x0000000102f01057 UIApplicationMain + 159
42 Bullseye 0x0000000101d5bad7 main + 55
43 libdyld.dylib 0x000000010743f955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This might be because you have a bad connection in your outlets. Review them. If you have them changed in the view controller, you still need to update them in the storyboard.
the simulator is blank because your app is crashing. Check your storyboard outlet connections to make ensure they are all connected. Open the connections inspector and look out for any broken connections. If your connections are right the circles in your view controller should be filled (see image below)

xcode: class is not key value coding-compliant [duplicate]

This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 5 years ago.
I'm currently working myself through this tutorial:
https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ConnectTheUIToCode.html#//apple_ref/doc/uid/TP40015214-CH22-SW1
After creating the function for the button(at ~2/3 on the page) I tried running the code and got the Exception:
2017-12-08 11:24:31.343183+0100 FoodTracker[2159:154603] ***
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FoodTracker.ViewController 0x7fea6f406820> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key setDefaultLabelText.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d7512b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001060fcf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000109d75079 -[NSException raise] + 9
3 Foundation 0x0000000105b1ba63 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x0000000106b39117 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x0000000106e2ac2d -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000109d183cd -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x0000000106e295e3 -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x0000000106b403ff -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x0000000106b40d2b -[UIViewController loadView] + 177
10 UIKit 0x0000000106b4105c -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x0000000106b418b9 -[UIViewController view] + 27
12 UIKit 0x0000000106a0c7cf -[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKit 0x0000000106a0ced7 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x0000000106a1fe54 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x00000001069928b8 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4737
16 UIKit 0x0000000106997aeb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
17 UIKit 0x0000000106d616f8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
18 UIKit 0x00000001071374c8 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKit 0x0000000106d612f1 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
20 UIKit 0x0000000106d61b6b -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 696
21 UIKit 0x00000001076dfa69 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
22 UIKit 0x00000001076df922 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
23 UIKit 0x00000001073bc9c8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
24 UIKit 0x00000001075bbb06 _performActionsWithDelayForTransitionContext + 100
25 UIKit 0x00000001073bc88b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
26 UIKit 0x0000000107136b25 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
27 UIKit 0x000000010699636a -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
28 UIKit 0x0000000106f71605 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
29 FrontBoardServices 0x000000010bc38cc0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
30 FrontBoardServices 0x000000010bc417b5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
31 libdispatch.dylib 0x000000010ae9733d _dispatch_client_callout + 8
32 libdispatch.dylib 0x000000010ae9c9f3 _dispatch_block_invoke_direct + 592
33 FrontBoardServices 0x000000010bc6d498 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
34 FrontBoardServices 0x000000010bc6d14e -[FBSSerialQueue _performNext] + 464
35 FrontBoardServices 0x000000010bc6d6bd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
36 CoreFoundation 0x0000000109d18101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x0000000109db7f71 __CFRunLoopDoSource0 + 81
38 CoreFoundation 0x0000000109cfca19 __CFRunLoopDoSources0 + 185
39 CoreFoundation 0x0000000109cfbfff __CFRunLoopRun + 1279
40 CoreFoundation 0x0000000109cfb889 CFRunLoopRunSpecific + 409
41 GraphicsServices 0x000000010c5019c6 GSEventRunModal + 62
42 UIKit 0x00000001069995d6 UIApplicationMain + 159
43 FoodTracker 0x00000001057e7b67 main + 55
44 libdyld.dylib 0x000000010af13d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is my Code:
And the connections inspector of the button:
This is due to FoodTracker VC in storyboard has an outlet created but not connected.
How to resolve the issue? Follow these steps.
Open your storyboard, click on view controller below view controller scene.
Check for all outlets for ViewController.
Remove those outlets created and are not connected to ViewController.swift implementation file.
Keep me updated on the same.
Check your connection to #IBAction with this steps below:
In the storyboard:
In your view controller:
Updated:
In your case, you should remove connection in Reference Outlets because you connect it to the label outlet.

Terminating app due to uncaught exception 'NSInternalInconsistencyException' with name 'OverlayView'

I intend to use a custom view Koloda in my newly-created swift xcode project via Podfile. After pod install, creating KolodaView in Main.storyboard and building successfully, it complains exception when running as follows:
2016-08-20 09:44:38.918 MsgNotFree[25760:2220650] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/jasonzhu/Library/Developer/CoreSimulator/Devices/DDE42B9D-6304-4552-AD30-A1BFA3A7B3E0/data/Containers/Bundle/Application/D1282CEB-9914-4C37-BCD2-DC05675C9FD1/MsgNotFree.app> (loaded)' with name 'OverlayView''
*** First throw call stack:
(
0 CoreFoundation 0x000000010a227d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c8d4deb objc_exception_throw + 48
2 CoreFoundation 0x000000010a227cbd +[NSException raise:format:] + 205
3 UIKit 0x000000010b720c89 -[UINib instantiateWithOwner:options:] + 499
4 UIKit 0x000000010b723415 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 223
5 MsgNotFree 0x0000000109eedd90 _TFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 368
6 MsgNotFree 0x0000000109eedf92 _TToFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 66
7 MsgNotFree 0x0000000109eee918 _TTDFC10MsgNotFree19FirstViewController6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 56
8 MsgNotFree 0x0000000109eee085 _TTWC10MsgNotFree19FirstViewControllerS_20KolodaViewDataSourceS_FS1_6kolodafTCS_10KolodaView25viewForCardOverlayAtIndexSu_GSqCS_11OverlayView_ + 53
9 Koloda 0x0000000109ff14f5 _TFC6Koloda10KolodaView13configureCardfTCS_17DraggableCardView7atIndexSu_T_ + 501
10 Koloda 0x0000000109ff15b2 _TToFC6Koloda10KolodaView13configureCardfTCS_17DraggableCardView7atIndexSu_T_ + 66
11 Koloda 0x0000000109ff1183 _TFC6Koloda10KolodaView17createCardAtIndexfTSu5frameGSqVSC6CGRect__CS_17DraggableCardView + 611
12 Koloda 0x0000000109ff292b _TFC6Koloda10KolodaViewP33_DFF55D12D516409CF60937DD60F8B8969setupDeckfT_T_ + 955
13 Koloda 0x0000000109ff1e60 _TFC6Koloda10KolodaViewW10dataSourceXwGSqPS_20KolodaViewDataSource__ + 32
14 Koloda 0x0000000109ff1f60 _TFC6Koloda10KolodaViews10dataSourceXwGSqPS_20KolodaViewDataSource__ + 160
15 MsgNotFree 0x0000000109eec73e _TFC10MsgNotFree19FirstViewController11viewDidLoadfT_T_ + 398
16 MsgNotFree 0x0000000109eec802 _TToFC10MsgNotFree19FirstViewController11viewDidLoadfT_T_ + 34
17 UIKit 0x000000010b4f3984 -[UIViewController loadViewIfRequired] + 1198
18 UIKit 0x000000010b4f3cd3 -[UIViewController view] + 27
19 UIKit 0x000000010b5571bc -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 502
20 UIKit 0x000000010b556130 -[UITabBarController transitionFromViewController:toViewController:] + 59
21 UIKit 0x000000010b551f41 -[UITabBarController _setSelectedViewController:] + 377
22 UIKit 0x000000010b551db7 -[UITabBarController setSelectedViewController:] + 234
23 UIKit 0x000000010b408680 +[UIView(Animation) performWithoutAnimation:] + 65
24 UIKit 0x000000010b54bddc -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 344
25 UIKit 0x000000010b54d5df -[UITabBarController viewWillAppear:] + 193
26 UIKit 0x000000010b4f92bd -[UIViewController _setViewAppearState:isAnimating:] + 710
27 UIKit 0x000000010b4f9958 -[UIViewController __viewWillAppear:] + 149
28 UIKit 0x000000010b401255 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 633
29 UIKit 0x000000010b40fc9e -[UIView(Internal) _addSubview:positioned:relativeTo:] + 481
30 UIKit 0x000000010b3ca29a -[UIWindow addRootViewControllerViewIfPossible] + 803
31 UIKit 0x000000010b3ca69d -[UIWindow _setHidden:forced:] + 282
32 UIKit 0x000000010b3dc180 -[UIWindow makeKeyAndVisible] + 42
33 UIKit 0x000000010b350ed9 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
34 UIKit 0x000000010b357568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1769
35 UIKit 0x000000010b354714 -[UIApplication workspaceDidEndTransaction:] + 188
36 FrontBoardServices 0x000000010d40f8c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
37 FrontBoardServices 0x000000010d40f741 -[FBSSerialQueue _performNext] + 178
38 FrontBoardServices 0x000000010d40faca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
39 CoreFoundation 0x000000010a14d301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
40 CoreFoundation 0x000000010a14322c __CFRunLoopDoSources0 + 556
41 CoreFoundation 0x000000010a1426e3 __CFRunLoopRun + 867
42 CoreFoundation 0x000000010a1420f8 CFRunLoopRunSpecific + 488
43 UIKit 0x000000010b353f21 -[UIApplication _run] + 402
44 UIKit 0x000000010b358f09 UIApplicationMain + 171
45 MsgNotFree 0x0000000109eec272 main + 114
46 libdyld.dylib 0x00000001112d892d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
In which, OverlayView class could be referenced to in ViewController, which means the third-party class is being referred to correctly in the project level.
The demonstrating project is here
Could anyone give me some hint where the problem could be? Great thanks!
this error is due to there is no overlayView named .xib file in your bundle,
create a new file -> UserInterface -> View -> (rename it OverlayView)
now got OverlayView and select view there change its class to OverlayView.

Moving Swift iOS app to support Apple TV as a new Target

Maybe somebody can help, I'm trying to move my app to facilitate a new target for the Apple TV.
I create the new Storyboard and linked everything the same way as it has been in the iOS application. When I'm trying to start the application I get the following exception, after the AppDelegate is executed (before it goes into the viewDidLoad of the initial controller.
Any ideas?
2015-09-19 12:24:44.629 App TV[46733:3797033] *** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CATransformLayer: 0x7fc1e0d51fc0> is a part of cycle in its layer tree'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e850105 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010f271deb objc_exception_throw + 48
2 CoreFoundation 0x000000010e85003d +[NSException raise:format:] + 205
3 QuartzCore 0x0000000111d2f74a _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 102
4 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
5 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
6 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
7 QuartzCore 0x0000000111d37439 _ZN2CA5Layer15insert_sublayerEPNS_11TransactionEP7CALayerm + 389
8 QuartzCore 0x0000000111d3782a -[CALayer addSublayer:] + 193
9 UIKit 0x000000010d2ce424 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1512
10 UIKit 0x000000010d5b1b56 -[UIButton initWithCoder:] + 1424
11 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
12 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
13 UIKit 0x000000010d5d1315 -[UIRuntimeConnection initWithCoder:] + 134
14 UIKit 0x000000010d5d1a77 -[UIRuntimeEventConnection initWithCoder:] + 60
15 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
16 UIKit 0x000000010d79df23 UINibDecoderDecodeObjectForValue + 1154
17 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
18 UIKit 0x000000010d5d0555 -[UINib instantiateWithOwner:options:] + 1255
19 UIKit 0x000000010d3ad7f2 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
20 UIKit 0x000000010d3ae11e -[UIViewController loadView] + 178
21 UIKit 0x000000010d3ae47d -[UIViewController loadViewIfRequired] + 139
22 UIKit 0x000000010d3aec7e -[UIViewController view] + 27
23 UIKit 0x000000010d289484 -[UIWindow addRootViewControllerViewIfPossible] + 61
24 UIKit 0x000000010d289b81 -[UIWindow _setHidden:forced:] + 302
25 UIKit 0x000000010d29b558 -[UIWindow makeKeyAndVisible] + 43
26 UIKit 0x000000010d216063 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
27 UIKit 0x000000010d21c5a8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
28 UIKit 0x000000010d219783 -[UIApplication workspaceDidEndTransaction:] + 188
29 FrontBoardServices 0x000000011097b7ac -[FBSSerialQueue _performNext] + 192
30 FrontBoardServices 0x000000011097bb1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
31 CoreFoundation 0x000000010e77c1b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
32 CoreFoundation 0x000000010e7720dc __CFRunLoopDoSources0 + 556
33 CoreFoundation 0x000000010e771593 __CFRunLoopRun + 867
34 CoreFoundation 0x000000010e770fa8 CFRunLoopRunSpecific + 488
35 UIKit 0x000000010d2190d5 -[UIApplication _run] + 402
36 UIKit 0x000000010d21de09 UIApplicationMain + 171
37 App TV 0x000000010d0b8fdd main + 109
38 libdyld.dylib 0x00000001149699e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Funny thing happening, apparently the new Apple TV (4th Gen / tvOS v9.0) can't handle 'Word Wrap' on a button, after setting it to 'Truncate Middle' it starts up fine. Maybe an issue in the beta.
On Xcode 7.2 I had this same error caused by setting the Line Break on a button to 'Character Wrap'. Changing to 'Truncate Middle' stopped the crash.
You can be notified where the exception occurs by activating Exception Breakpoints, then you will be able to see what happens.
You can do so by going on the Breakpoint navigator on Xcode, then on the Plus button at the bottom left.

Resources