Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: NSInternalInconsistencyException - Unexpected subviews #225

Open
rscherf opened this issue Aug 15, 2019 · 2 comments
Open

Crash: NSInternalInconsistencyException - Unexpected subviews #225

rscherf opened this issue Aug 15, 2019 · 2 comments

Comments

@rscherf
Copy link

rscherf commented Aug 15, 2019

I've tried dismiss, endEditing and isActive = false before turning the viewController in PageboyViewControllerDataSource, but it seems this doesn't happen soon enough for the crash to happen.

Steps to reproduce:

  1. Add two viewControllers, one which uses a UISearchController
  2. Open the page with the search controller, and select it so the keyboard presents
  3. Try to switch pages without dismissing the search controller keyboard
  4. Experience the following crash:
  5. I have confirmed that manually dismissing the UISearchController via a different button, then switching pages, prevents the crash.
2019-08-15 10:27:13.858884-0500 Payment[22260:1738119] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected subviews'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000011353d6fb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000112ae1ac5 objc_exception_throw + 48
	2   CoreFoundation                      0x000000011353d482 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x000000010ff41927 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
	4   UIKitCore                           0x000000011cd6c4ce -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:] + 379
	5   UIKitCore                           0x000000011cd6cbda -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:] + 720
	6   UIKitCore                           0x000000011cd6e5d8 -[_UIQueuingScrollView _enqueueAnimatedScrollInDirection:withView:completion:] + 2400
	7   UIKitCore                           0x000000011cd6f20a -[_UIQueuingScrollView setView:direction:animated:completion:] + 145
	8   UIKitCore                           0x000000011cd5ff19 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 650
	9   UIKitCore                           0x000000011cd600c7 -[UIPageViewController setViewControllers:direction:animated:completion:] + 263
	10  Pageboy                             0x0000000110ef7aa3 $s7Pageboy0A14ViewControllerC07_updateB11Controllers33_851B1239E1F9FEE02C965B8A745BA4AFLL2to4fromAF9direction8animated5async5force10completionySaySo06UIViewC0CG_S2iAC19NavigationDirectionOS3bySbcSgtFyycfU0_ + 1571
	11  Pageboy                             0x0000000110efa6d8 $s7Pageboy0A14ViewControllerC07_updateB11Controllers33_851B1239E1F9FEE02C965B8A745BA4AFLL2to4fromAF9direction8animated5async5force10completionySaySo06UIViewC0CG_S2iAC19NavigationDirectionOS3bySbcSgtFyycfU0_TA + 72
	12  Pageboy                             0x0000000110ef7e37 $s7Pageboy0A14ViewControllerC07_updateB11Controllers33_851B1239E1F9FEE02C965B8A745BA4AFLL2to4fromAF9direction8animated5async5force10completionySaySo06UIViewC0CG_S2iAC19NavigationDirectionOS3bySbcSgtFyycfU1_ + 55
	13  Pageboy                             0x0000000110efa731 $s7Pageboy0A14ViewControllerC07_updateB11Controllers33_851B1239E1F9FEE02C965B8A745BA4AFLL2to4fromAF9direction8animated5async5force10completionySaySo06UIViewC0CG_S2iAC19NavigationDirectionOS3bySbcSgtFyycfU1_TA + 17
	14  Pageboy                             0x0000000110ef7e7d $sIeg_IeyB_TR + 45
	15  libdispatch.dylib                   0x00000001154d6d7f _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00000001154d7db5 _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00000001154e5080 _dispatch_main_queue_callback_4CF + 1540
	18  CoreFoundation                      0x00000001134a48a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	19  CoreFoundation                      0x000000011349ef56 __CFRunLoopRun + 2310
	20  CoreFoundation                      0x000000011349e302 CFRunLoopRunSpecific + 626
	21  GraphicsServices                    0x000000011632f2fe GSEventRunModal + 65
	22  UIKitCore                           0x000000011d3dcba2 UIApplicationMain + 140
	23  Payment                             0x000000010d8aeeeb main + 75
	24  libdyld.dylib                       0x000000011554c541 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
@asadullahpranto
Copy link

asadullahpranto commented Aug 13, 2023

Facing exactly the same issue here, any hack?

@rscherf
Copy link
Author

rscherf commented Aug 13, 2023

This is what worked for me:

I have confirmed that manually dismissing the UISearchController via a different button, then switching pages, prevents the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants