iOS: fix List Crash when insert more rows
This commit is contained in:
@@ -231,10 +231,10 @@ - (void)blend:(NSDictionary *)props {
|
|||||||
NSIndexPath *p = [NSIndexPath indexPathForRow:l inSection:0];
|
NSIndexPath *p = [NSIndexPath indexPathForRow:l inSection:0];
|
||||||
[indexPaths addObject:p];
|
[indexPaths addObject:p];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@available(iOS 11.0, *)) {
|
if (@available(iOS 11.0, *)) {
|
||||||
[self.view performBatchUpdates:^{
|
|
||||||
@try {
|
@try {
|
||||||
|
[self.view performBatchUpdates:^{
|
||||||
|
|
||||||
if (oldLoadMore != self.loadMore) {
|
if (oldLoadMore != self.loadMore) {
|
||||||
if (self.loadMore) {
|
if (self.loadMore) {
|
||||||
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
||||||
@@ -246,10 +246,10 @@ - (void)blend:(NSDictionary *)props {
|
|||||||
} else {
|
} else {
|
||||||
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
||||||
}
|
}
|
||||||
|
} completion:nil];
|
||||||
} @catch (NSException *exception) {
|
} @catch (NSException *exception) {
|
||||||
[self.view reloadData];
|
[self.view reloadData];
|
||||||
}
|
}
|
||||||
} completion:nil];
|
|
||||||
} else {
|
} else {
|
||||||
[self.view reloadData];
|
[self.view reloadData];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user