Browse Source

fix : dispatch_get_main_queue

Marino Faggiana 7 years ago
parent
commit
feea4bc3f6
1 changed files with 7 additions and 4 deletions
  1. 7 4
      iOSClient/Networking/CCNetworking.m

+ 7 - 4
iOSClient/Networking/CCNetworking.m

@@ -1123,13 +1123,16 @@
             NSLog(@"[LOG] Upload file %@ TaskIdentifier %lu", fileName, (unsigned long)uploadTask.taskIdentifier);
         }
 
-        // refresh main
-        if ([self.delegate respondsToSelector:@selector(reloadDatasource:)])
-            [self.delegate reloadDatasource:serverUrl];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            // refresh main
+            if ([self.delegate respondsToSelector:@selector(reloadDatasource:)])
+                [self.delegate reloadDatasource:serverUrl];
         
 #ifndef EXTENSION
-        [app updateApplicationIconBadgeNumber];
+            [app updateApplicationIconBadgeNumber];
 #endif
+        });
+        
      });
 }