소스 검색

if we need to remove table rows we should to it at once

Tobias Conradi 10 년 전
부모
커밋
a7a5fb3bb0
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      VLC for iOS WatchKit Extension/VLCWatchTableController.m

+ 4 - 1
VLC for iOS WatchKit Extension/VLCWatchTableController.m

@@ -105,11 +105,14 @@
     }
     // update on the same page
     else {
+        NSMutableIndexSet *removeRowIndexes = [NSMutableIndexSet new];
         [oldObjects enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
             if ([removedSet containsObject:obj]) {
-                [table removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:idx]];
+                [removeRowIndexes addIndex:idx];
             }
         }];
+        [table removeRowsAtIndexes:removeRowIndexes];
+
         [newObjects enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
             if ([addedSet containsObject:obj]) {
                 NSString *rowType = [self rowTypeForObject:obj];