Closed gca3020 closed 8 years ago
hey @gca3020 I am not sure what you are trying to do.
That's strange. That's very similar to what I'm doing, except mine is crashing. Only when I have the search bar active.
Other minor differences are that my table currently has no items in it (empty array), and that I'm moving tabs between two instances of the same TableVC, both with a search bar at the top.
Some additional details on the exception:
2016-02-01 06:43:17.183 MyApp[8384:2378159] *** Assertion failure in -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.30.14/_UIQueuingScrollView.m:332 2016-02-01 06:43:17.191 MyApp[8384:2378159] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected subviews' *** First throw call stack:
A Google search shows this, which looks similar: http://stackoverflow.com/questions/24675000/uipageviewcontroller-nsinternalinconsistencyexception
I am having the exact same issue with an UISearchBar. when it's in focus or firstResponder and I click on a different tab it crashes. my code is the same as @gca3020's
any updates on this issue?
This crash is cause by UISearchController, so you should consider dismissing the search before changing tab
I had the similar issue. If you are hiding the search bar on tab switch make sure you are hiding it in the delegate function
func carbonTabSwipeNavigation(_ carbonTabSwipeNavigation: CarbonTabSwipeNavigation, willMoveAt index: UInt)
This will solve the problem I guess. I was playing with the constraint of the search bar. so I put the code in the above function and it worked well.
As stated in the title. I have a single subclass of UITableViewController that I am instantiating multiple times (holding different subsets of data in each). I have a UISearchController initialized in the viewController, and the tableView.tableHeaderView is set as searchController.searchBar.
` let searchController = UISearchController(searchResultsController: nil)
`
If I click into the search field and start searching, and then switch view controllers by swiping or clicking on a new one, I get a crash.
From the debugging output, it looks like there is an exception thrown:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected subviews'