UITableViewAlertForLayoutOutsideViewHierarchy

Hi i get an error


[TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <UITableView: 0x102094800; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x282dac3f0>; layer = <CALayer: 0x2823fb9c0>; contentOffset: {0, -64}; contentSize: {320, 248}; adjustedContentInset: {64, 0, 49, 0}; dataSource: <IOUUOMe.UOMeViewController: 0x10140a340>>


And really the question is what is this error stating and how do i fix it. This happens when i tap an UIBarButton on an Navigation Bar. I have put an symbolic breakpoint which is how i found the button that was causing the error but how do i get rid of this error. and fix it properly

just posted a bug to Apple Developer Feedback...this is still an issue in iPadOS 17 App is using a UISplitViewController with the new column style init. Both primary and secondary child view controllers are subclasses of UITableViewController (yes, I need to move to CollectionViewController ASAP)...

This bug occurs when I am in landscape and select iPadOS "Split View" by tapping on the 3 dots menu on top of the screen. As my app slides to the left, this Xcode console occurs. The backtrace from the symbolic break point indicates there are NO calls in my code in the back trace. This is an apple UIKit bug! Workaround for overriding layouSubviews likely to work...

here's the backtrace...

(lldb) bt

  • thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1

    • frame #0: 0x00000001942cd8dc UIKitCore`UITableViewAlertForLayoutOutsideViewHierarchy

      frame #1: 0x0000000193579fd0 UIKitCore`-[UITableView _updateVisibleCellsNow:] + 208

      frame #2: 0x0000000193579e34 UIKitCore`-[UITableView layoutSubviews] + 148

      frame #3: 0x000000019332797c UIKitCore`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1528

      frame #4: 0x000000019273caa8 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 500

      frame #5: 0x000000019332aa2c UIKitCore`-[UIView(Hierarchy) layoutBelowIfNeeded] + 296

      frame #6: 0x000000019341efac UIKitCore`-[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 128

      frame #7: 0x000000019337b590 UIKitCore`-[_UIViewControllerTransitionContext __runAlongsideAnimations] + 272

      frame #8: 0x0000000193aa0fc4 UIKitCore`-[_UIWindowAnimationController animateTransition:] + 288

      frame #9: 0x00000001936a363c UIKitCore`-[UIWindow _adjustSizeClassesAndResizeWindowToFrame:] + 620

      frame #10: 0x000000019337e29c UIKitCore`-[UIWindow _resizeWindowFrameToSceneBoundsIfNecessary] + 204

      frame #11: 0x000000019346402c UIKitCore`-[UIWindow _sceneBoundsDidChange] + 64

      frame #12: 0x0000000193465490 UIKitCore-[_UIScenefbsSceneBasedMetricsCalculator _updateMetricsOnWindows:animated:] + 940 frame #13: 0x00000001934650bc UIKitCore-[UIWindowScene _computeMetricsForWindows:animated:] + 88

      frame #14: 0x00000001935287b8 UIKitCore`__55-[UIWindowScene _computeMetrics:withTransitionContext:]_block_invoke + 104

      frame #15: 0x00000001935282b0 UIKitCore`-[UIWindowScene _computeTraitCollectionAndCoordinateSpaceForcingDelegateCallback:withAction:] + 296

      frame #16: 0x000000019352817c UIKitCore`-[UIWindowScene _computeMetrics:withTransitionContext:] + 104

      frame #17: 0x00000001943290b8 UIKitCore`-[UIWindowScene _computeMetricsAndCrossFadeInLiveResize:withTransitionContext:] + 192

      frame #18: 0x000000019342dd98 UIKitCore`+[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736

      frame #19: 0x000000019342d620 UIKitCore`_UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224

      frame #20: 0x0000000193609fac UIKitCore`-[_UIWindowSceneGeometrySettingsDiffAction _updateSceneGeometryWithSettingObserverContext:windowScene:transitionContext:] + 448

      frame #21: 0x000000019342f728 UIKitCore`-[_UIWindowSceneGeometrySettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 1048

      frame #22: 0x00000001937b10a8 UIKitCore`__64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.225 + 612

      frame #23: 0x000000019342c454 UIKitCore`-[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216

      frame #24: 0x000000019342c2c4 UIKitCore`-[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244

      frame #25: 0x000000019342c104 UIKitCore`-[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336

      frame #26: 0x00000001a955c5b4 FrontBoardServices`-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 660

      frame #27: 0x00000001a955c300 FrontBoardServices`__94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152

      frame #28: 0x00000001a955c19c FrontBoardServices`-[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168

      frame #29: 0x00000001a955c0b8 FrontBoardServices`__94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344

      frame #30: 0x0000000105d36b34 libdispatch.dylib`_dispatch_client_callout + 20

      frame #31: 0x0000000105d3a530 libdispatch.dylib`_dispatch_block_invoke_direct + 300

      frame #32: 0x00000001a9558520 FrontBoardServices`FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52

      frame #33: 0x00000001a95584a0 FrontBoardServices`-[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240

      frame #34: 0x00000001a9558378 FrontBoardServices`-[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28

      frame #35: 0x000000019110112c CoreFoundation`CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28

      frame #36: 0x00000001911003a8 CoreFoundation`__CFRunLoopDoSource0 + 176

      frame #37: 0x00000001910feb5c CoreFoundation`__CFRunLoopDoSources0 + 244

      frame #38: 0x00000001910fd898 CoreFoundation`__CFRunLoopRun + 828

      frame #39: 0x00000001910fd478 CoreFoundation`CFRunLoopRunSpecific + 608

      frame #40: 0x00000001d46564f8 GraphicsServices`GSEventRunModal + 164

      frame #41: 0x000000019352162c UIKitCore`-[UIApplication _run] + 888

      frame #42: 0x0000000193520c68 UIKitCore`UIApplicationMain + 340

      frame #43: 0x0000000104eb4220 MyApp`main at AppDelegate.swift:13:7

      frame #44: 0x00000001b3e22dcc dyld`start + 2240

UITableViewAlertForLayoutOutsideViewHierarchy
 
 
Q