Просмотр исходного кода

Fixed warning: multiple accesses to weak variable.

Not a huge deal in this case, but it's always a good idea to get a strong reference to the object we only have a weak reference to so that it can't go away half-way through the execution of a block (which in some cases can cause bugs that are super hard to track down)
Javier Soto лет назад: 12
Родитель
Сommit
4ffacae080
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

+ 3 - 2
Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

@@ -50,8 +50,9 @@
             }
             }
             
             
             dispatch_async(dispatch_get_main_queue(), ^{
             dispatch_async(dispatch_get_main_queue(), ^{
-                weakSelf.recursiveSize = @(totalSize);
-                [weakSelf.tableView reloadData];
+              FLEXFileBrowserTableViewController *__strong strongSelf = weakSelf;
+                strongSelf.recursiveSize = @(totalSize);
+                [strongSelf.tableView reloadData];
             });
             });
         });
         });