dzenbot / DZNEmptyDataSet

A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display
https://www.cocoacontrols.com/controls/dznemptydataset
MIT License
12.09k stars 1.73k forks source link

crash msg:*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], #439

Open IDwuqing opened 5 years ago

IDwuqing commented 5 years ago

the throw exception code is : // If found, call original implementation if (impPointer) { ((void(*)(id,SEL))impPointer)(self,_cmd); } sometimes crash I don't know why

xyxsan commented 5 years ago

same crash

alobaili commented 3 years ago

I'm also facing this issue. In my case, I'm just reloading a cell like this:

DispatchQueue.main.async {
    self.tableView.beginUpdates()
    self.tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
    self.tableView.endUpdates()
}

I'm doing this in the success case of an API call.

part of my crash log:

Last Exception Backtrace:
0   CoreFoundation                  0x18d66186c __exceptionPreprocess + 220 (NSException.m:199)
1   libobjc.A.dylib                 0x1a25d0c50 objc_exception_throw + 60 (objc-exception.mm:565)
2   CoreFoundation                  0x18d567000 +[NSException raise:format:arguments:] + 100 (NSException.m:146)
3   Foundation                      0x18e8fb91c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 132 (NSException.m:231)
4   UIKitCore                       0x19020c7f8 -[UITableView _Bug_Detected_In_Client_Of_UITableView_Invalid_Number_Of_Sections:] + 132 (UITableView.m:2430)
5   UIKitCore                       0x19020be90 -[UITableView _endCellAnimationsWithContext:] + 9620 (UITableView.m:2329)
6   UIKitCore                       0x190224224 -[UITableView endUpdatesWithContext:] + 128 (UITableView.m:7694)
7   DZNEmptyDataSet                 0x100c4413c dzn_original_implementation + 172 (UIScrollView+EmptyDataSet.m:609)
alobaili commented 3 years ago

Is there a way to prevent this method swizzling from happening? I suspect it's somehow the cause of this crash.

alobaili commented 3 years ago

Update:

This crash happened during App Store review and resulted in rejecting my app.

I really hope it is investigated and fixed sooner than later.

dzenbot commented 3 years ago

@alobaili you can always implement your own, or attempt to fix, or not use? Seriously.

https://github.com/dzenbot/DZNEmptyDataSet/blob/master/LICENSE#L9 == "Use at your own risk"

alobaili commented 3 years ago

@dzenbot I understand the risks. I just wanted to share my experience. Consider it feedback or bug report to help the creators investigate and improve.

Best,