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 in dzn_original_implementation when working with PFQueryTableViewController (Parse) #127

Open UberJason opened 9 years ago

UberJason commented 9 years ago

Hi there,

I know this is random, but I'm getting a crash when working with a PFQueryTableViewController using the Parse SDK. Specifically, when I delete an object in the data set (through Parse) and call [self loadObjects], there's an exception on line 517:

screen shot 2015-08-25 at 10 09 20 pm

The exact error itself is "Assertion failure in -[UITableView _endCellAnimationsWithContext:]", and the exception stack shows that dzn_original_implementation is the second-to-last call before the crash:

screen shot 2015-08-25 at 10 07 48 pm

Any idea what's going on? I don't know enough about either the inner workings of Parse or DZNEmptyDataSet to track down what's going on. DZNEmptyDataSet and Parse have played together just fine elsewhere in my app, so I'm not sure what's different specifically here.

shayanbo commented 9 years ago

wrong row count changement when you make cell animation such as insertion or deletion.

UberJason commented 9 years ago

I'm aware that this is commonly the problem, but it's not in this case. The error does not occur if I stop using DZNEmptyDataSet, and I've carefully checked that the row counts are correct. It looks more like something funny going on with the method swizzling.

dzenbot commented 9 years ago

Method swizzling is so fragile. I Wish there was a better way of detecting reloadData.

orinmurphy commented 8 years ago

Im having the exact same issue. Anyone figure this out?

jstheoriginal commented 8 years ago

Having this same issue in the same point within dzn_original_implementation, but it happens in UITableView endUpdates with this console message:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect of header in invalid section (1)'

It only seems to happen on iOS 8.2 or earlier (sim and device)--iOS 8.3 and up is fine. And it only happens after the app has been backgrounded and returns to a view where this tableView updating gets called. So it's likely just an iOS bug?

screenshot 2016-04-22 10 22 45

elprl commented 8 years ago

I'm getting this on ios 9.3 UITableView endUpdates when working with Realm fine-grained notifications.

chaseacton commented 7 years ago

Any update on this? I'm still seeing this crash on iOS 10.

kasyanov-ms commented 7 years ago

The same thing. Had to remove beginUpdates/endUpdates from the project.

poojaagarwal1331 commented 7 years ago

Any update on this issue?

chaseacton commented 7 years ago

We had to remove DZNEmptyDataSet from our project because of this bug. This is why you don't method swizzle.

romeugodoi commented 6 years ago

Any update on this? I'm seeing this crash on iOS 11.

wongzigii commented 6 years ago

Any update on this?

colinhumber commented 6 years ago

The crash you're seeing is likely nothing with the library, but the swizzled method hiding the true cause of the crash. If you set the tableView's emptyDataSource and emptyDelegate both to nil to disable using this library you should see what the true cause of the crash is.

The swizzling can hide the actual point in your code where the crash is occurring.