You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/25 08:10:40 UTC

[6/9] incubator-weex git commit: * [ios] add try catch for some exceptions

* [ios] add try catch for some exceptions


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/cd00544b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cd00544b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cd00544b

Branch: refs/heads/0.13-dev
Commit: cd00544ba3b706cda41f4f5f852c6a2fa6666723
Parents: 1879e11
Author: acton393 <zh...@gmail.com>
Authored: Thu May 25 15:08:52 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu May 25 15:08:52 2017 +0800

----------------------------------------------------------------------
 .../WeexSDK/Sources/Component/WXListComponent.m | 37 ++++++++++++--------
 1 file changed, 22 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/cd00544b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
index eb5c12f..7e391ef 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -281,24 +281,31 @@
             WXLogDebug(@"Insert section:%ld", (unsigned long)insertIndex);
             
             [UIView performWithoutAnimation:^{
-                [_tableView beginUpdates];
-                
-                [_completedSections insertObject:completedInsertSection atIndex:insertIndex];
-                if (completedReloadSection) {
-                    WXLogDebug(@"Reload section:%lu", insertIndex - 1);
-                    _completedSections[insertIndex - 1] = completedReloadSection;
-                }
-                
-                [self _insertTableViewSectionAtIndex:insertIndex keepScrollPosition:keepScrollPosition animation:UITableViewRowAnimationNone];
-                
-                if (completedReloadSection) {
-                    [_tableView reloadSections:[NSIndexSet indexSetWithIndex:insertIndex - 1] withRowAnimation:UITableViewRowAnimationNone];
-                }
-                
-                [_tableView endUpdates];
+                 @try {
+                    [_tableView beginUpdates];
+                    
+                    [_completedSections insertObject:completedInsertSection atIndex:insertIndex];
+                    if (completedReloadSection) {
+                        WXLogDebug(@"Reload section:%lu", insertIndex - 1);
+                        _completedSections[insertIndex - 1] = completedReloadSection;
+                    }
+                    
+                    [self _insertTableViewSectionAtIndex:insertIndex keepScrollPosition:keepScrollPosition animation:UITableViewRowAnimationNone];
+                    
+                    if (completedReloadSection) {
+                        [_tableView reloadSections:[NSIndexSet indexSetWithIndex:insertIndex - 1] withRowAnimation:UITableViewRowAnimationNone];
+                    }
+                    
+                    [_tableView endUpdates];
+                 } @catch (NSException *exception) {
+                     WXLog(@"%@ %@",NSStringFromSelector(_cmd), exception);
+                 } @finally {
+                     
+                 }
             }];
             
         }];
+        
     }
 }