Переглянути джерело

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

Tobias Conradi 10 роки тому
батько
коміт
a7a5fb3bb0

+ 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];