소스 검색

VLCPlaybackController: The delegate is not always a UIViewController instead use the topmost controller

Carola Nitz 7 년 전
부모
커밋
f71180b520
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      Sources/VLCPlaybackController.m

+ 4 - 1
Sources/VLCPlaybackController.m

@@ -1195,10 +1195,13 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
                                                                                                                              [self setPlaybackPosition:lastPosition];
                                                                                                                          }]
                                                              ];
+                UIViewController *presentingVC = [UIApplication sharedApplication].delegate.window.rootViewController;
+                presentingVC = presentingVC.presentedViewController ?: presentingVC;
                 [VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"CONTINUE_PLAYBACK", nil)
                                                      errorMessage:[NSString stringWithFormat:NSLocalizedString(@"CONTINUE_PLAYBACK_LONG", nil), item.title]
-                                                   viewController:self.delegate
+                                                   viewController:presentingVC
                                                     buttonsAction:buttonsAction];
+
             }
         }
     }