App crashes with NSInternalInconsistencyException', reason: 'Could not load NIB in bundle' - ios

Everyone I'm working on a iOS Static Library. when I use this static library in sample app and run it, it crashes with below exception...
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/name/Library/Developer/CoreSimulator/Devices/D982246E-72D6-482F-8E1C-AE3D1BF37607/data/Containers/Bundle/Application/016193F2-36A3-492D-8E7B-CE560FACCF6D/TestApp.app> (loaded)' with name 'OptionsViewController''
*** First throw call stack:
(
0 CoreFoundation 0x0000000107385c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010701ebb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107385b9d +[NSException raise:format:] + 205
3 UIKit 0x0000000107d30171 -[UINib instantiateWithOwner:options:] + 552
4 UIKit 0x0000000107b88718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
5 UIKit 0x0000000107b88d08 -[UIViewController loadView] + 109
6 UIKit 0x0000000107b88f79 -[UIViewController loadViewIfRequired] + 75
7 UIKit 0x0000000107b8940e -[UIViewController view] + 27
8 UIKit 0x0000000107bae297 -[UINavigationController _startCustomTransition:] + 633
9 UIKit 0x0000000107bba3bf -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
10 UIKit 0x0000000107bbaf0e -[UINavigationController __viewWillLayoutSubviews] + 43
11 UIKit 0x0000000107d05715 -[UILayoutContainerView layoutSubviews] + 202
12 UIKit 0x0000000107ad8a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
13 QuartzCore 0x000000010bcbeec2 -[CALayer layoutSublayers] + 146
14 QuartzCore 0x000000010bcb36d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
15 QuartzCore 0x000000010bcb3546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
16 QuartzCore 0x000000010bc1f886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
17 QuartzCore 0x000000010bc20a3a _ZN2CA11Transaction6commitEv + 462
18 QuartzCore 0x000000010bc210eb _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
19 CoreFoundation 0x00000001072b8ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x00000001072b8c00 __CFRunLoopDoObservers + 368
21 CoreFoundation 0x00000001072aea33 __CFRunLoopRun + 1123
22 CoreFoundation 0x00000001072ae366 CFRunLoopRunSpecific + 470
23 GraphicsServices 0x000000010b7e7a3e GSEventRunModal + 161
24 UIKit 0x0000000107a58900 UIApplicationMain + 1282
25 TestApp 0x0000000106a54bcf main + 111
26 libdyld.dylib 0x0000000109b7f145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I know, generally this error mean that OptionsViewController xib file is not been included in this library/project but guess what? OptionsViewController's .m file present in compile Sources and .h and .xib file present there in copy files of Build Phases of library.
This library was working file with Xcode 6.1. The time I install Xcode 6.3. this crash came in to picture, now it is not working even in Xcode 6.1
Now I'm clueless why my sample app keep crashing. It has been 1 whole day, I have been struggling with this particular issue without any luck.
Any guidance, clue, anything would be highly appreciated.
UPDATE
App not able to find Resources, files, anything from Static Library.
I have to include all .h , .xibs and resources files in to build face of sample app to make it work, which is not a right way to do it I feel.

Try [[OptionsViewController alloc] initWithNibName:#"OptionsViewController" bundle:[NSBundle bundleForClass:[OptionsViewController class]]]; instead.

Related

Understanding the Crash Log

I am an Android Developer and trying some dummy for the iOS development.
I am trying a tutorial for AMSlideMenu and it was working well at a certain point of development.
I followed the complete tutorial and it worked well. After sometime while I was experimenting some other functionality the code breaked.
I undo and reverted back the changes but something still looks wrong.
below is the crash log, but i cant understand what went wrong
*** First throw call stack:
(
0 CoreFoundation 0x000000010bdf93f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b6e9bb7 objc_exception_throw + 45
2 UIKit 0x000000010c7bd43b -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 Pranshu1 0x000000010b1a0d4f -[AMSlideMenuMainViewController setup] + 1071
4 Pranshu1 0x000000010b19dc63 -[AMSlideMenuMainViewController viewDidLoad] + 419
5 Pranshu1 0x000000010b19d1b6 -[MainViewController viewDidLoad] + 54
6 UIKit 0x000000010c7bb190 -[UIViewController loadViewIfRequired] + 738
7 UIKit 0x000000010c7e95db -[UINavigationController _layoutViewController:] + 44
8 UIKit 0x000000010c7e9b25 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
9 UIKit 0x000000010c7e9c24 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
10 UIKit 0x000000010c7ea9f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
11 UIKit 0x000000010c7eb4b7 -[UINavigationController __viewWillLayoutSubviews] + 43
12 UIKit 0x000000010c92f399 -[UILayoutContainerView layoutSubviews] + 202
13 UIKit 0x000000010c70f199 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
14 QuartzCore 0x000000010c521f98 -[CALayer layoutSublayers] + 150
15 QuartzCore 0x000000010c516bbe _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
16 QuartzCore 0x000000010c516a2e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
17 QuartzCore 0x000000010c484ade _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
18 QuartzCore 0x000000010c485bea _ZN2CA11Transaction6commitEv + 390
19 UIKit 0x000000010c69467d -[UIApplication _reportMainSceneUpdateFinished:] + 44
20 UIKit 0x000000010c695368 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2642
21 UIKit 0x000000010c693d22 -[UIApplication workspaceDidEndTransaction:] + 179
22 FrontBoardServices 0x00000001114912a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
23 CoreFoundation 0x000000010bd2eabc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
24 CoreFoundation 0x000000010bd24805 __CFRunLoopDoBlocks + 341
25 CoreFoundation 0x000000010bd245c5 __CFRunLoopRun + 2389
26 CoreFoundation 0x000000010bd23a06 CFRunLoopRunSpecific + 470
27 UIKit 0x000000010c693799 -[UIApplication _run] + 413
28 UIKit 0x000000010c696550 UIApplicationMain + 1282
29 Pranshu1 0x000000010b1ad003 main + 115
30 libdyld.dylib 0x000000010e822145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks in Advance
Looking up from the top (0) entry the last of your methods is: Pranshu1 so you need to look there.
The last method is: -[UIViewController shouldPerformSegueWithIdentifier:sender:]
so it looks like you are performing a Segue, check the identifier.
Before that is the method AMSlideMenuMainViewController so it looks like you are probably using the 3rd party code AMSlideMenu, check for correct usage.
Here is how to catch the exceptions at the point of the error:
To see the actual statement that is causing the error add an exception breakpoint:
From the Main Menu Debug:Breakpoints:Create Exception Breakpoint.
Right-click the breakpoint and set the exception to Objective-C.
Add an action: "po $arg1".
Run the app to get the breakpoint and you will be at the line that causes the exception and the error message will be in the debugger console.
Creating the breakpoint example:

uncaught exception of type NSException (connections seem fine) - Wenderlich tutorial

I'm a beginner working through Ray Wenderlich's Swift tutorial, Part 2.
The final code for the lesson (and with which I'm receiving the error) is here: http://cdn5.raywenderlich.com/wp-content/uploads/2014/06/TipCalculator-Demo4.zip
When I build the app through Xcode 6.3.2 and run it on the iOS simulator (iPhone 6), I get the error message below (sorry for the poor formatting).
I did a search on both Google and StackOverflow, seems like people often run into similar errors but are able to fix it by going to the view controller, checking the Connections Inspector, and fixing any of the connections that are flagged (e.g., an object being connected to no longer exists).
Note: I don't have any flags in my Connections Inspector -- everything seems fine there, including the connection between resultsTextView and Text View object in the Storyboard (please see attached photo)
Please let me know how to solve this - thanks.
---------See Connection Inspector on far right - looks fine!-----------
http://i.imgur.com/X6eA05F.png
---------Error message---------
2015-06-05 17:07:39.866 TipCalculator[4848:128801] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key resultsTextView.'
* First throw call stack:
(
0 CoreFoundation 0x0000000100216c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000101d81bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001002168a9 -[NSException raise] + 9
3 Foundation 0x0000000100634b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010015ed50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x0000000100d8d52b -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x0000000100be5718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x0000000100be5d08 -[UIViewController loadView] + 109
8 UIKit 0x0000000100be5f79 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x0000000100c1601b -[UINavigationController _layoutViewController:] + 44
10 UIKit 0x0000000100c16565 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
11 UIKit 0x0000000100c16664 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
12 UIKit 0x0000000100c17448 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
13 UIKit 0x0000000100c17f0e -[UINavigationController __viewWillLayoutSubviews] + 43
14 UIKit 0x0000000100d62715 -[UILayoutContainerView layoutSubviews] + 202
15 UIKit 0x0000000100b35a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
16 QuartzCore 0x0000000104916ec2 -[CALayer layoutSublayers] + 146
17 QuartzCore 0x000000010490b6d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x000000010490b546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
19 QuartzCore 0x0000000104877886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
20 QuartzCore 0x0000000104878a3a _ZN2CA11Transaction6commitEv + 462
21 UIKit 0x0000000100ab3a2d -[UIApplication _reportMainSceneUpdateFinished:] + 44
22 UIKit 0x0000000100ab46f1 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2648
23 UIKit 0x0000000100ab30d5 -[UIApplication workspaceDidEndTransaction:] + 179
24 FrontBoardServices 0x00000001038915e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
25 CoreFoundation 0x000000010014a41c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26 CoreFoundation 0x0000000100140165 __CFRunLoopDoBlocks + 341
27 CoreFoundation 0x000000010013f947 __CFRunLoopRun + 887
28 CoreFoundation 0x000000010013f366 CFRunLoopRunSpecific + 470
29 UIKit 0x0000000100ab2b42 -[UIApplication _run] + 413
30 UIKit 0x0000000100ab5900 UIApplicationMain + 1282
31 TipCalculator 0x000000010002c177 main + 135
32 libdyld.dylib 0x00000001024d9145 start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Make sure you follow those steps correctly:
Open Main.storyboard and select your View Controller in the Document
Outline. Open the Connections Inspector (6th tab), and you will see
all of the properties you created listed in the Outlets section.
021_ConnectionsInspector You’ll notice a small circle to the right of
resultsTextView. Control-drag from that button down to the text view
below the Calculate button, and release to connect your Swift property
to this view.
I believe you are missing the #IBOutlet that is create in this step

Could not load NIB in bundle error

I am setting up parse and have some problems. I am using a storyboard to do this. However I am getting a error saying
2014-04-08 23:11:59.802 ParseStarterProject[5729:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/user/Library/Application Support/iPhone Simulator/7.1-64/Applications/CCA0F113-88E5-4181-A5A0-77841C12939E/ParseStarterProject.app> (loaded)' with name 'MainWindow''
*** First throw call stack:
(
0 CoreFoundation 0x0000000102d1f495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010258a99e objc_exception_throw + 43
2 CoreFoundation 0x0000000102d1f2ad +[NSException raise:format:] + 205
3 UIKit 0x0000000101392742 -[UINib instantiateWithOwner:options:] + 775
4 UIKit 0x00000001013942a0 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 138
5 UIKit 0x000000010113760d -[UIApplication _loadMainNibFileNamed:bundle:] + 42
6 UIKit 0x000000010113693e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 454
7 UIKit 0x0000000101147d4c -[UIApplication handleEvent:withNewEvent:] + 3189
8 UIKit 0x0000000101148216 -[UIApplication sendEvent:] + 79
9 UIKit 0x0000000101138086 _UIApplicationHandleEvent + 578
10 GraphicsServices 0x0000000102c4c71a _PurpleEventCallback + 762
11 GraphicsServices 0x0000000102c4c1e1 PurpleEventCallback + 35
12 CoreFoundation 0x0000000102ca1679 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
13 CoreFoundation 0x0000000102ca144e __CFRunLoopDoSource1 + 478
14 CoreFoundation 0x0000000102cca903 __CFRunLoopRun + 1939
15 CoreFoundation 0x0000000102cc9d83 CFRunLoopRunSpecific + 467
16 UIKit 0x00000001011362e1 -[UIApplication _run] + 609
17 UIKit 0x0000000101137e33 UIApplicationMain + 1010
18 ParseStarterProject 0x0000000100002f83 main + 115
19 ParseStarterProject 0x0000000100001fd4 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Why am I getting this, and are there possible fixes?
Regarding the error message and the "MainWindow". I guess, you deleted a UIWindow from the storyboard, which is still referenced in you AppDelegate.
Could you validate this by checking, whether there is some Zombie-reference of a MainWindow-Class?
In case you added a Storyboard for being new main interface:
Please make sure, you also set this new Storyboard as new Main Interface in your Build target. Herefore, go to your xCode-Project file and select the build target. In the General tab set the "Main Interface" to match your new storyboard

'NSInternalInconsistencyException', reason: 'custom navigation transition - no popping between different orientations!'

I'm facing a problem with UIViewController containment via MFSideMenu.
Problem is, on ViewControllers that support orientation, opening the side menu and selecting a different menu option (when the device is in landscape mode) causes the app to crash. This behavior worked perfectly in iOS 6, but is now failing in iOS 7.
Here's the stack trace:
2014-03-05 14:40:00.335 MyApp[21890:70b]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'custom navigation transition - no popping between different orientations!'
*** First throw call stack:
(
0 CoreFoundation 0x024515e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x021098b6 objc_exception_throw + 44
2 CoreFoundation 0x024513bb +[NSException raise:format:] + 139
3 UIKit 0x009434b4 -[UINavigationController _startCustomTransition:] + 988
4 UIKit 0x009500c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
5 UIKit 0x00950cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
6 UIKit 0x00a8a181 -[UILayoutContainerView layoutSubviews] + 213
7 UIKit 0x00880267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
8 libobjc.A.dylib 0x0211b81f -[NSObject performSelector:withObject:] + 70
9 QuartzCore 0x01ecd2ea -[CALayer layoutSublayers] + 148
10 QuartzCore 0x01ec10d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
11 QuartzCore 0x01ec0f40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
12 QuartzCore 0x01e28ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
13 QuartzCore 0x01e29e71 _ZN2CA11Transaction6commitEv + 393
14 QuartzCore 0x01e2a544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
15 CoreFoundation 0x024194ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
16 CoreFoundation 0x0241941f __CFRunLoopDoObservers + 399
17 CoreFoundation 0x023f7344 __CFRunLoopRun + 1076
18 CoreFoundation 0x023f6ac3 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x023f68db CFRunLoopRunInMode + 123
20 GraphicsServices 0x036979e2 GSEventRunModal + 192
21 GraphicsServices 0x03697809 GSEventRun + 104
22 UIKit 0x00815d3b UIApplicationMain + 1225
23 MyApp 0x000022aa main + 138
24 libdyld.dylib 0x02e9f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any help in debugging this is appreciate.
P/S: Note the spelling mistake for "orientation" in the console log. I'm leaving it misspelt in case others stumble upon this problem as well.
Please check whether you are having the below functions.If then, please disable those and try,
(BOOL) shouldAutoRotate;
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
remove all orientation related methods.
Thanks,
ithay.

Application crash after updated to IOS7

I have updated my app to IOS7 and now I have very strange issue.
When I start app it start to do what it suppose to do and after 3-5 minutes app stops to work. But not completely. It stops to send notifications, track location etc.
And if I try to make some action I get this in console:
*** First throw call stack:
(
0 CoreFoundation 0x0305f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0276e8b6 objc_exception_throw + 44
2 CoreFoundation 0x0305f3bb +[NSException raise:format:] + 139
3 UIKit 0x0157465c -[UINib instantiateWithOwner:options:] + 951
4 UIKit 0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
5 UIKit 0x013e743d -[UIViewController loadView] + 302
6 UIKit 0x013e773e -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
8 UIKit 0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
9 UIKit 0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
10 UIKit 0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
11 UIKit 0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
12 UIKit 0x0154839d -[UILayoutContainerView layoutSubviews] + 213
13 UIKit 0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
14 UIKit 0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x0278081f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x00ef972a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x00e564e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x00f12870 +[CATransaction flush] + 52
22 UIKit 0x012f0979 _afterCACommitHandler + 131
23 CoreFoundation 0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x0302748f __CFRunLoopDoObservers + 399
25 CoreFoundation 0x030053b4 __CFRunLoopRun + 1076
26 CoreFoundation 0x03004b33 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x0300494b CFRunLoopRunInMode + 123
28 GraphicsServices 0x03ce89d7 GSEventRunModal + 192
29 GraphicsServices 0x03ce87fe GSEventRun + 104
30 UIKit 0x012d494b UIApplicationMain + 1225
31 MyApp 0x0000759d main + 141
32 libdyld.dylib 0x02c53725 start + 0
33 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any idea what is this?
App works fine in IOS6.
Create an exception breakpoint in Xcode that stops on all exceptions. Then the debugger will stop when that exception is raised. It looks like it is in
[UINib instantiateWithOwner:options:]
But I can't tell if you are calling that or the system.
See here for a related issue:
Terminating app due to uncaught exception 'NSUnknownKeyException'
I must test this on real phone just to be sure.
I have a piece of code that refreshes some labels in the view every X seconds.
It works fine until IOS7. On IOS7 app crashes after 3 minutes and I get the error from the question.
Every time I refresh labels in the view I was opened a new connection to sqlite to get data.
In IOS7 I get error so I made one instance of data access class and init it only in viewDidLoad() and now it works fine.
If after test I confirm that I am right I will definitely make singleton pattern of my data access class.

Resources