Parcourir la source

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

Tobias Conradi il y a 10 ans
Parent
commit
a7a5fb3bb0
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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];