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: Invalid batch updates detected: the number of sections and/or items returned by the data source before and after performing the batch updates are inconsistent with the updates. #859

Open
Arshad-iOSDeveloper opened this issue Dec 18, 2023 · 0 comments

Comments

@Arshad-iOSDeveloper
Copy link

Environment:

  • XLPagerTabStrip: 9.1.0,
  • Xcode: 14.3.1
  • iOS version: 17.1.2
  • iPhone: 14 Pro

Crash Stack Trace:
Fatal Exception: NSInternalInconsistencyException
Invalid batch updates detected: the number of sections and/or items returned by the data source before and after performing the batch updates are inconsistent with the updates. Data source before updates = { 1 section with item counts: [4] } Data source after updates = { 1 section with item counts: [1] } Updates = [ ] Collection view: <XLPagerTabStrip.ButtonBarView: 0x10585f000; baseClass = UICollectionView; frame = (0 168; 393 40); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x28147f690>; backgroundColor = <UIDynamicSystemColor: 0x280f4af00; name = systemBackgroundColor>; layer = <CALayer: 0x281a79800>; contentOffset: {0, 0}; contentSize: {518.66666666666663, 40}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewFlowLayout: 0x104230090>; dataSource: <CrelioHealth_for_Doctors.WaitingListView: 0x10602e200>>

Example Code
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { return getChildViewControllers() }

private func getChildViewControllers() -> [UIViewController] { guard let presenter = self.presenter else { return [] } var childViewControllers = [UIViewController]() testMenuArray.enumerated().forEach { (index, testMenuName) in let childView = presenter.createSwipeViews(index: index, lastFromDate: lastAPIcallFromDate, lastToDate: lastAPIcallToDate, waitingListDelegate: self, reportStatus: testMenuName) childViewControllers.append(childView) } return childViewControllers }

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

No branches or pull requests

1 participant