浏览代码

VLCOneDrive: fix tvOS build

UIAlertView is not available on tvOS so we need to use the UIAlertController instead
Carola Nitz 7 年之前
父节点
当前提交
163896a4e8
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      Sources/VLCOneDriveObject.m

+ 10 - 6
Sources/VLCOneDriveObject.m

@@ -216,12 +216,16 @@
         }
         [receivedSub writeToFile:FileSubtitlePath atomically:YES];
     } else {
-        VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"DISK_FULL", nil)
-                                                          message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), [subtitleURL lastPathComponent], [[UIDevice currentDevice] model]]
-                                                         delegate:self
-                                                cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil)
-                                                otherButtonTitles:nil];
-        [alert show];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"DISK_FULL", nil)
+                                                                                 message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), [subtitleURL lastPathComponent], [[UIDevice currentDevice] model]]
+                                                                          preferredStyle:UIAlertControllerStyleAlert];
+
+        UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil)
+                                                           style:UIAlertActionStyleCancel
+                                                         handler:nil];
+
+        [alertController addAction:okAction];
+        [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertController animated:YES completion:nil];
     }
 
     return FileSubtitlePath;