You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/10/11 11:47:33 UTC

[GitHub] cxfeng1 closed pull request #1628: [iOS]Catch exception 'NSInternalInconsistencyException', reason: 'Mis…

cxfeng1 closed pull request #1628: [iOS]Catch exception 'NSInternalInconsistencyException', reason: 'Mis…
URL: https://github.com/apache/incubator-weex/pull/1628
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
index 55116af68a..b4cc6c77c7 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm
@@ -904,7 +904,12 @@ - (void)_performUpdates:(void(^)(void))updates withKeepScrollPosition:(BOOL)keep
 - (void)_insertTableViewSectionAtIndex:(NSUInteger)section keepScrollPosition:(BOOL)keepScrollPosition animation:(UITableViewRowAnimation)animation
 {
     [self _performUpdates:^{
-        [_tableView insertSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:animation];
+        // catch system exception under 11.2 https://forums.developer.apple.com/thread/49676
+        @try {
+            [_tableView insertSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:animation];
+        } @catch(NSException *) {
+            
+        }
     } withKeepScrollPosition:keepScrollPosition adjustmentBlock:^CGFloat(NSIndexPath *top) {
         if (section <= top.section) {
             return [self tableView:_tableView heightForHeaderInSection:section];
@@ -917,7 +922,13 @@ - (void)_insertTableViewSectionAtIndex:(NSUInteger)section keepScrollPosition:(B
 - (void)_deleteTableViewSectionAtIndex:(NSUInteger)section keepScrollPosition:(BOOL)keepScrollPosition animation:(UITableViewRowAnimation)animation
 {
     [self _performUpdates:^{
-        [_tableView deleteSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:animation];
+        // catch system exception under 11.2 https://forums.developer.apple.com/thread/49676
+        @try {
+            [_tableView deleteSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:animation];
+        } @catch(NSException *) {
+            
+        }
+
     } withKeepScrollPosition:keepScrollPosition adjustmentBlock:^CGFloat(NSIndexPath *top) {
         if (section <= top.section) {
             return [self tableView:_tableView heightForHeaderInSection:section];
@@ -933,7 +944,12 @@ - (void)_insertTableViewCellAtIndexPath:(NSIndexPath *)indexPath keepScrollPosit
         if ([_updataType  isEqual: @"reload"]) {
             [_tableView reloadData];
         } else {
-            [_tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:animation];
+            // catch system exception under 11.2 https://forums.developer.apple.com/thread/49676
+            @try {
+                [_tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:animation];
+            } @catch(NSException *e) {
+                
+            }
         }
     } withKeepScrollPosition:keepScrollPosition adjustmentBlock:^CGFloat(NSIndexPath *top) {
         if (([indexPath compare:top] <= 0) || [_updataType  isEqual: @"reload"]) {
@@ -950,7 +966,12 @@ - (void)_deleteTableViewCellAtIndexPath:(NSIndexPath *)indexPath keepScrollPosit
         return ;
     }
     [self _performUpdates:^{
-        [_tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:animation];
+        // catch system exception under 11.2 https://forums.developer.apple.com/thread/49676
+        @try {
+            [_tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:animation];
+        } @catch (NSException* e) {
+            
+        }
     } withKeepScrollPosition:keepScrollPosition adjustmentBlock:^CGFloat(NSIndexPath *top) {
         if ([indexPath compare:top] <= 0) {
             return [self tableView:_tableView heightForRowAtIndexPath:indexPath];


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services