I have a navigation controller app. I created a RootViewController class with Xib file. In that xib file I had table view and nothing more else. Toolbar and buttons on the toolbar I created in program way. Table view had datasourse and delegate File Owner.
I deleted this xib file, and created a new one with previous name. Created it like viewBased xib file and then I dropped down to it table view, toolbar, two buttons on toolbar. Add outlets on them. Saved it all. Clear all targets. Build all. And Run. Application crashes on start! Anyone know where may be the problem? Thanx!
Stack:
[Session started at 2010-11-16 15:00:52 +0200.]
2010-11-16 15:00:53.729 PhoneBook[16210:207] ******* Accessibility Status Changed: On
2010-11-16 15:00:53.755 PhoneBook[16210:207] ********** Loading AX for: com.yourcompany.PhoneBook ************
2010-11-16 15:00:53.798 PhoneBook[16210:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x02510b99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0266040e objc_exception_throw + 47
2 CoreFoundation 0x024c9238 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x024c91aa +[NSException raise:format:] + 58
4 UIKit 0x0036aa40 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x00368675 -[UIViewController loadView] + 120
6 UIKit 0x004c1c8c -[UITableViewController loadView] + 80
7 UIKit 0x0036854f -[UIViewController view] + 56
8 UIKit 0x003669f4 -[UIViewController contentScrollView] + 42
9 UIKit 0x003767e2 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
10 UIKit 0x00374ea3 -[UINavigationController _layoutViewController:] + 43
11 UIKit 0x0037612d -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
12 UIKit 0x00370ccd -[UINavigationController _startDeferredTransitionIfNeeded] + 266
13 UIKit 0x0048db55 -[UILayoutContainerView layoutSubviews] + 226
14 QuartzCore 0x0456a481 -[CALayer layoutSublayers] + 177
15 QuartzCore 0x0456a1b1 CALayerLayoutIfNeeded + 220
16 QuartzCore 0x045632e0 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
17 QuartzCore 0x04563040 _ZN2CA11Transaction6commitEv + 292
18 UIKit 0x002c104e -[UIApplication _reportAppLaunchFinished] + 39
19 UIKit 0x002c1477 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 545
20 UIKit 0x002cb3ec -[UIApplication handleEvent:withNewEvent:] + 1958
21 UIKit 0x002c3b3c -[UIApplication sendEvent:] + 71
22 UIKit 0x002c89bf _UIApplicationHandleEvent + 7672
23 GraphicsServices 0x02d6c822 PurpleEventCallback + 1550
24 CoreFoundation 0x024f1ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
25 CoreFoundation 0x02452807 __CFRunLoopDoSource1 + 215
26 CoreFoundation 0x0244fa93 __CFRunLoopRun + 979
27 CoreFoundation 0x0244f350 CFRunLoopRunSpecific + 208
28 CoreFoundation 0x0244f271 CFRunLoopRunInMode + 97
29 UIKit 0x002c0c6d -[UIApplication _run] + 625
30 UIKit 0x002ccaf2 UIApplicationMain + 1160
31 PhoneBook 0x00002494 main + 102
32 PhoneBook 0x00002425 start + 53
)
terminate called after throwing an instance of 'NSException'
* Terminating app due to uncaught exception
'NSInternalInconsistencyException',
reason: '-[UIViewController
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the
view outlet was not set.'
Your view controller lost connection for view outlet, you need to restore it in IB (as you do with all outlets)
Related
The app crashes in simulator when one item is pressed on the slide out menu (created with table view), I've tried deleting connections between UI and IB and remaking them incase this is the issue, but it hasn't solved it.
This is the error code that comes out:
View Controller is : <AKSwiftSlideMenu.HomeVC: 0x7fa6c5e05b90>
Calculate your own repayment
2017-02-08 17:36:13.782 AKSwiftSlideMenu[37086:3161182] Unknown class TrackerVC in Interface Builder file.
2017-02-08 17:36:13.801 AKSwiftSlideMenu[37086:3161182] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fa6c5d1f920> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key AnnualInterestInput.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a9a0d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a40221e objc_exception_throw + 48
2 CoreFoundation 0x000000010a9a0c99 -[NSException raise] + 9
3 Foundation 0x0000000109f109df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x000000010af5f293 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010b1d379e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010a9459e0 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x000000010b1d2122 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x000000010af659c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x000000010af662e7 -[UIViewController loadView] + 177
10 UIKit 0x000000010af6661c -[UIViewController loadViewIfRequired] + 201
11 UIKit 0x000000010af6d062 -[UIViewController __viewWillAppear:] + 118
12 UIKit 0x000000010af981d3 -[UINavigationController _startCustomTransition:] + 1290
13 UIKit 0x000000010afa8e48 -[UINavigationController _startDeferredTransitionIfNeeded:] + 697
14 UIKit 0x000000010afa9fdb -[UINavigationController __viewWillLayoutSubviews] + 58
15 UIKit 0x000000010b1a0dd7 -[UILayoutContainerView layoutSubviews] + 223
16 UIKit 0x000000010ae89ab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
17 QuartzCore 0x000000010f85fbf8 -[CALayer layoutSublayers] + 146
18 QuartzCore 0x000000010f853440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
19 QuartzCore 0x000000010f8532be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
20 QuartzCore 0x000000010f7e1318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
21 QuartzCore 0x000000010f80e3ff _ZN2CA11Transaction6commitEv + 475
22 UIKit 0x000000010adef7f0 _afterCACommitHandler + 346
23 CoreFoundation 0x000000010a945267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24 CoreFoundation 0x000000010a9451d7 __CFRunLoopDoObservers + 391
25 CoreFoundation 0x000000010a929f8e __CFRunLoopRun + 1198
26 CoreFoundation 0x000000010a929884 CFRunLoopRunSpecific + 420
27 GraphicsServices 0x000000010f02fa6f GSEventRunModal + 161
28 UIKit 0x000000010adc4c68 UIApplicationMain + 159
29 AKSwiftSlideMenu 0x0000000109e0401f main + 111
30 libdyld.dylib 0x000000010e09f68d start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
According to the error, it most probably is that one of your views is connected to an outlet named AnnualInterestInput that was deleted from the class.
If by deleting all the outlets and reconnecting them to the view controller didn't work it out, then it may be due to a wrong class in the xib.
This means that you have set a wrong class in the xib or storyboard and it's not able to found the key. If the class is still correct, check if the module is correct!
This line is what gives me a hint that this could be the problem:
2017-02-08 17:36:13.782 AKSwiftSlideMenu[37086:3161182] Unknown class TrackerVC in Interface Builder file.
I am learning how to make iPhone apps in the simulator but my app crashes as soon as it launches in the simulator. Also, there are no errors and no warnings when I compile the source code.
Here is a copy of the console logs -
2011-10-27 04:49:08.376 login[1192:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'LoginView''
* Call stack at first throw:
(
0 CoreFoundation 0x00dc85a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f1c313 objc_exception_throw + 44
2 CoreFoundation 0x00d80ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d80e6a +[NSException raise:format:] + 58
4 UIKit 0x004b30fa -[UINib instantiateWithOwner:options:] + 2024
5 UIKit 0x004b4ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
6 UIKit 0x0036a628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
7 UIKit 0x00368134 -[UIViewController loadView] + 120
8 UIKit 0x0036800e -[UIViewController view] + 56
9 login 0x000029c3 -[loginViewController viewDidLoad] + 165
10 UIKit 0x004b2f26 -[UINib instantiateWithOwner:options:] + 1556
11 UIKit 0x004b4ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
12 UIKit 0x002ba17a -[UIApplication _loadMainNibFile] + 172
13 UIKit 0x002bacf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
14 UIKit 0x002c5617 -[UIApplication handleEvent:withNewEvent:] + 1533
15 UIKit 0x002bdabf -[UIApplication sendEvent:] + 71
16 UIKit 0x002c2f2e _UIApplicationHandleEvent + 7576
17 GraphicsServices 0x01720992 PurpleEventCallback + 1550
18 CoreFoundation 0x00da9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
19 CoreFoundation 0x00d09cf7 __CFRunLoopDoSource1 + 215
20 CoreFoundation 0x00d06f83 __CFRunLoopRun + 979
21 CoreFoundation 0x00d06840 CFRunLoopRunSpecific + 208
22 CoreFoundation 0x00d06761 CFRunLoopRunInMode + 97
23 UIKit 0x002ba7d2 -[UIApplication _run] + 623
24 UIKit 0x002c6c93 UIApplicationMain + 1160
25 login 0x00002694 main + 102
26 login 0x00002625 start + 53
)
terminate called after throwing an instance of 'NSException'
I have tried and tried and can't seem to fix this problem. I will appreciate any help.
Your app is trying to load a file called LoginView.xib, and failing to. Seems like this file is referenced from your MainWindow.xib (or whichever is your main nib file as defined in your application plist). Check that this file exists, is copied to the bundle (in the copy resources build phase). If that's the case you can try cleaning the project, restarting xCode and trying again (I had this problem occasionally, for no apparent reason when switching between iPhone/iPad targets).
I am developing an iOS application (http://affogato.visioa.com/) that implements a tab bar controller, navigation controller and a tableview controller and each time I run my application, I get: "Thread 1: Program recieved signal: "SIGABRT". Could anyone shed any light as to why I am getting this and how to correct it?
Below is the console:
2011-08-28 13:13:57.070 Affogato[16469:b303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "CoffeesView" nib but didn't get a UITableView.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc95a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f1d313 objc_exception_throw + 44
2 CoreFoundation 0x00d81ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d81e6a +[NSException raise:format:] + 58
4 UIKit 0x00224e9b -[UITableViewController loadView] + 275
5 UIKit 0x000cb00e -[UIViewController view] + 56
6 UIKit 0x000c9482 -[UIViewController contentScrollView] + 42
7 UIKit 0x000d9f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
8 UIKit 0x000d8555 -[UINavigationController _layoutViewController:] + 43
9 UIKit 0x000d9870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
10 UIKit 0x000d432a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
11 UIKit 0x001ef2e9 -[UILayoutContainerView layoutSubviews] + 226
12 QuartzCore 0x016b3a5a -[CALayer layoutSublayers] + 181
13 QuartzCore 0x016b5ddc CALayerLayoutIfNeeded + 220
14 QuartzCore 0x0165b0b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
15 QuartzCore 0x0165c294 _ZN2CA11Transaction6commitEv + 292
16 UIKit 0x0001d9c9 -[UIApplication _reportAppLaunchFinished] + 39
17 UIKit 0x0001de83 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 690
18 UIKit 0x00028617 -[UIApplication handleEvent:withNewEvent:] + 1533
19 UIKit 0x00020abf -[UIApplication sendEvent:] + 71
20 UIKit 0x00025f2e _UIApplicationHandleEvent + 7576
21 GraphicsServices 0x01002992 PurpleEventCallback + 1550
22 CoreFoundation 0x00daa944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
23 CoreFoundation 0x00d0acf7 __CFRunLoopDoSource1 + 215
24 CoreFoundation 0x00d07f83 __CFRunLoopRun + 979
25 CoreFoundation 0x00d07840 CFRunLoopRunSpecific + 208
26 CoreFoundation 0x00d07761 CFRunLoopRunInMode + 97
27 UIKit 0x0001d7d2 -[UIApplication _run] + 623
28 UIKit 0x00029c93 UIApplicationMain + 1160
29 Affogato 0x00001ed9 main + 121
30 Affogato 0x00001e55 start + 53
31 ??? 0x00000001 0x0 + 1
)
terminate called throwing an exception
The first line of your console log gives the reason for the SIGABRT:
2011-08-28 13:13:57.070 Affogato[16469:b303] *** Terminating app
due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UITableViewController loadView]
loaded the "CoffeesView" nib but didn't get a UITableView.'
If you intended to use a UITableViewController, it is looking in the NIB file for a UITableView to control - is there one there?
On the other hand, if you didn't mean to use this kind of controller, just change it to a UIViewController in the .h file.
I was getting the same error message and in my case the "view" outlet of table view was not connected in the storyboard scene. Control drag from ViewController object to the UITableView object embedded in the scene. HTH.
I had a same problem with the storyboard. the solution was very simple, In the storyboard, i was using the UIViewController class for my viewcontroller scene which should be actually UITableViewController. I just deleted my UIViewController scene and created new UITableViewController scene, the error went away.
I am pretty sure the same problem you have if you are using storyboard. If you are not using storyboard then make sure the class name you are setting in the XIB should be UITableViewController or Your custom class must inherit the UITableViewController in .h file and also make sure your view outlet set to your controller.
This error can also happen if you are using storyboards.
If you start a project as a universal app using storyboard then later change the project to support only in phone when you run the app on a iPad you may see this error.
To fix it temporally change the project back to universal and set the iPad storyboard to use the iPhone one, then set you project back to iPhone.
just an FYI
I think you should change:
[coffeeTypesArray objectAtIndex:row]
to
[coffeeTypesArray objectAtIndex:indexPath.row]
After adding a new searchbar on the RootViewController.xib, and connecting it with the FileOwner, the App will crash. It reports the stack when crash:
2011-07-17 17:12:43.756 TableView[1397:207] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: '-[UIViewController
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet
was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc85a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f1c313 objc_exception_throw + 44
2 CoreFoundation 0x00d80ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d80e6a +[NSException raise:format:] + 58
4 UIKit 0x0036a709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x00368134 -[UIViewController loadView] + 120
6 UIKit 0x004c1dd8 -[UITableViewController loadView] + 80
7 UIKit 0x0036800e -[UIViewController view] + 56
8 UIKit 0x003667f5 -[UIViewController nextResponder] + 34
9 UIKit 0x003874a6 -[UIResponder _containsResponder:] + 41
10 UIKit 0x00371c4e -[UINavigationController defaultFirstResponder] + 80
11 UIKit 0x00386647 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 42
12 UIKit 0x00386663 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 70
13 UIKit 0x00386406 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 42
14 TableView 0x00002a0a -[TableViewAppDelegate application:didFinishLaunchingWithOptions:] + 135
15 UIKit 0x002b8c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
16 UIKit 0x002bad88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
17 UIKit 0x002c5617 -[UIApplication handleEvent:withNewEvent:] + 1533
18 UIKit 0x002bdabf -[UIApplication sendEvent:] + 71
19 UIKit 0x002c2f2e _UIApplicationHandleEvent + 7576
20 GraphicsServices 0x01720992 PurpleEventCallback + 1550
21 CoreFoundation 0x00da9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
22 CoreFoundation 0x00d09cf7 __CFRunLoopDoSource1 + 215
23 CoreFoundation 0x00d06f83 __CFRunLoopRun + 979
24 CoreFoundation 0x00d06840 CFRunLoopRunSpecific + 208
25 CoreFoundation 0x00d06761 CFRunLoopRunInMode + 97
26 UIKit 0x002ba7d2 -[UIApplication _run] + 623
27 UIKit 0x002c6c93 UIApplicationMain + 1160
28 TableView 0x00002960 main + 102
29 TableView 0x000028f1 start + 53
30 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Well I don't know what you want us to tell you more then your error is already telling you.
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: '-[UIViewController
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but
the view outlet was not set.'
That is that you forgot to connect your view outlet of your RootViewController so it does not know what to load. The RootViewController of your MainWindow is the first thing that's going to be loaded, if it does not know what view it should display it will give you the above error.
here the situation: i have a viewcontroller which calls in the function "viewDidLoad" a function in the AppDelegateIphone to terminate this view.
The problem is that this exception comes if i make this:
splashScreen.view = nil;
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SplashScreenController_iPhone" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x029dc919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02b2a5de objc_exception_throw + 47
2 CoreFoundation 0x02995078 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x02994fea +[NSException raise:format:] + 58
4 UIKit 0x0062a09c -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x00627cd1 -[UIViewController loadView] + 120
6 UIKit 0x00627bab -[UIViewController view] + 56
7 regioappv2 0x00003085 -[AppDelegate_iPhone application:didFinishLaunchingWithOptions:] + 97
8 UIKit 0x00580543 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
9 UIKit 0x005829a1 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 346
10 UIKit 0x0058c452 -[UIApplication handleEvent:withNewEvent:] + 1958
11 UIKit 0x00585074 -[UIApplication sendEvent:] + 71
12 UIKit 0x00589ac4 _UIApplicationHandleEvent + 7495
13 GraphicsServices 0x030bfafa PurpleEventCallback + 1578
14 CoreFoundation 0x029bddc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
15 CoreFoundation 0x0291e737 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x0291b9c3 __CFRunLoopRun + 979
17 CoreFoundation 0x0291b280 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x0291b1a1 CFRunLoopRunInMode + 97
19 UIKit 0x00582226 -[UIApplication _run] + 625
20 UIKit 0x0058db58 UIApplicationMain + 1160
21 regioappv2 0x000028b4 main + 102
22 regioappv2 0x00002845 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
if I call the function with the splashScreen.view = nil; in the appDelegate itself, then everything is working just fine.
Please tell me where is my fault, or wheather I should post more code.
regards
loaded the "SplashScreenController_iPhone" nib but the view outlet was not set.
Have you made the view outlet in interface builder? Seems that you have not set it up correctly. And also from the stack trace, it's clear that viewDidLoad haven't been called, as the view is yet to be successfully loaded.