Kaynağa Gözat

fix runtime exceptions

Felix Paul Kühne 10 yıl önce
ebeveyn
işleme
2e90ee50c6
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      Sources/VLCDownloadViewController.m

+ 3 - 3
Sources/VLCDownloadViewController.m

@@ -274,7 +274,7 @@
                                                      delegate:self
                                             cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil)
                                             otherButtonTitles:nil];
-    [alert show];
+    [alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
 }
 
 - (void)progressUpdatedTo:(CGFloat)percentage receivedDataSize:(CGFloat)receivedDataSize  expectedDownloadSize:(CGFloat)expectedDownloadSize
@@ -348,12 +348,12 @@
     _FTPDownloadRequest = nil;
     [self downloadEnded];
 
-    VLCAlertView * alert = [[VLCAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"ERROR_NUMBER", nil), request.error.errorCode]
+    VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"ERROR_NUMBER", nil), request.error.errorCode]
                                                        message:request.error.message
                                                       delegate:self
                                              cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil)
                                              otherButtonTitles:nil];
-    [alert show];
+    [alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
 }
 
 #pragma mark - table view data source