Selaa lähdekoodia

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

Tobias Conradi 10 vuotta sitten
vanhempi
commit
a7a5fb3bb0
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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];