Foundation _userInfoForFileAndLine crash

Could anyone give some insights to identify the root cause for this crash?

Fatal Exception: NSInternalInconsistencyException
Layout requested for visible navigation bar, <UINavigationBar: 0x120e74280; frame = (0 0; 430 56); autoresize = W; tintColor = <UIDynamicProviderColor: 0x300488b20; provider = <__NSMallocBlock__: 0x300a60900>>; layer = <CALayer: 0x3000f0380>> delegate=0x1277a4600 standardAppearance=0x302d5c770 scrollEdgeAppearance=0x302d5d500, when the top item belongs to a different navigation bar. topItem = <UINavigationItem: 0x10a7d8500> title='Transfers' style=navigator leftBarButtonItems=0x300690020 rightBarButtonItems=0x300613ff0, navigation bar = <UINavigationBar: 0x11a8ef200; frame = (0 0; 430 44); opaque = NO; autoresize = W; layer = <CALayer: 0x3002a44c0>> delegate=0x1277a0c00, possibly from a client attempt to nest wrapped navigation controllers.

====

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x827cc __exceptionPreprocess
1  libobjc.A.dylib                0x172e4 objc_exception_throw
2  Foundation                     0x80f8d8 _userInfoForFileAndLine
3  UIKitCore                      0x2b63e8 -[UINavigationBar layoutSubviews]
4  UIKitCore                      0xd688 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
5  UIKitCore                      0x14dc14 -[UINavigationBar layoutSublayersOfLayer:]
6  QuartzCore                     0x78c28 CA::Layer::layout_if_needed(CA::Transaction*)
7  QuartzCore                     0x787b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
8  QuartzCore                     0xcf914 CA::Context::commit_transaction(CA::Transaction*, double, double*)
9  QuartzCore                     0x4e7c4 CA::Transaction::commit()
10 QuartzCore                     0x91a0c CA::Transaction::flush_as_runloop_observer(bool)
11 UIKitCore                      0xa3568 _UIApplicationFlushCATransaction
12 UIKitCore                      0xa0b64 __setupUpdateSequence_block_invoke_2
13 UIKitCore                      0xa09d8 _UIUpdateSequenceRun
14 UIKitCore                      0xa0628 schedulerStepScheduledMainSection
15 UIKitCore                      0xa159c runloopSourceCallback
16 CoreFoundation                 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
17 CoreFoundation                 0x562bc __CFRunLoopDoSource0
18 CoreFoundation                 0x53dc0 __CFRunLoopDoSources0
19 CoreFoundation                 0x52fbc __CFRunLoopRun
20 CoreFoundation                 0x52830 CFRunLoopRunSpecific
21 GraphicsServices               0x11c4 GSEventRunModal
22 UIKitCore                      0x3d2eb0 -[UIApplication _run]
23 UIKitCore                      0x4815b4 UIApplicationMain
24 XX                           0xa0f64 main + 7 (main.m:7)
25 ???                            0x1abb6eec8 (Missing)

Primarily just what is stated in the log itself – this is an explicit crash that is detected when it is likely that the app would have instead hung due to trying to display the same UINavigationItem in two different UINavigationBars. While the situation stated in the crash report is the most likely cause, any case where two UINavigationBars are onscreen at the same time displaying the same UINavigationItem can cause this.

Another potential cause of this is trying to move a view controller between navigation controllers - if the view controller exists in both navigation controllers long enough for them either to attempt to layout, then you can get this crash. Changing order of operations should resolve this crash if that is what is happening (that is, make sure you remove from the old navigation controller before adding to the new one).

Foundation _userInfoForFileAndLine crash
 
 
Q