iOS: fix List Crash when insert more rows

This commit is contained in:
pengfei.zhou 2023-04-03 14:18:37 +08:00 committed by jingpeng
parent e345aa8879
commit 1add0f564c
2 changed files with 10 additions and 10 deletions

View File

@ -26,7 +26,7 @@
#import <yoga/Yoga.h>
@interface YGLayout ()
@property (nonatomic, assign, readonly) YGNodeRef node;
@property(nonatomic, assign, readonly) YGNodeRef node;
@end
void DoricAddEllipticArcPath(CGMutablePathRef path,

View File

@ -231,10 +231,10 @@ - (void)blend:(NSDictionary *)props {
NSIndexPath *p = [NSIndexPath indexPathForRow:l inSection:0];
[indexPaths addObject:p];
}
if (@available(iOS 11.0, *)) {
[self.view performBatchUpdates:^{
@try {
[self.view performBatchUpdates:^{
if (oldLoadMore != self.loadMore) {
if (self.loadMore) {
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
@ -246,10 +246,10 @@ - (void)blend:(NSDictionary *)props {
} else {
[self.view insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
}
} completion:nil];
} @catch (NSException *exception) {
[self.view reloadData];
}
} completion:nil];
} else {
[self.view reloadData];
}