Unequal objects IGListBindingSectionController crash
New issue checklist
- [X ] I have reviewed the
READMEand documentation - [ X] I have searched existing issues and this is not a duplicate
- [ X] I have attempted to reproduce the issue with our production app.
General information
IGListKitversion: 3.4.0- iOS version(s): 13.2.1
- CocoaPods version: 1.8.3
- Xcode version: 11.2.1
- Devices/Simulators affected: device
- Reproducible in the demo project? (Yes/No):
- Related issues:
Debug information
We have crash on IGAssert when section controller updates child sublist objects. I assume the row (cell) was reused and before update due to it was reused for different place have different number of objects. How to prevent it?
Place where it crashes is in IGListBindingSectionController during didUpdateToObject:
section controller contains oldObject.
- (void)didUpdateToObject:(id)object {
id oldObject = self.object;
self.object = object;
if (oldObject == nil) {
self.viewModels = [[self.dataSource sectionController:self viewModelsForObject:object] copy];
} else {
IGAssert([oldObject isEqualToDiffableObject:object],
@"Unequal objects %@ and %@ will cause IGListBindingSectionController to reload the entire section",
oldObject, object);
[self updateAnimated:YES completion:nil];
}
}
The crash happens when I navigate in stack far enough for the UIKit to release objects. Then I go back and the time when I pop to the controller it crashes.
@shial4 would you be able to provide a sample project that reproduces the crash?
@shial4 would you be able to provide a sample project that reproduces the crash?
Hopefully, yes. Will see over the weekend what can I do about it. I can reproduce it with our production app. There is a chance :)