Explorar el Código

VLCAlertView: make sure the completion handler is actually being called

Felix Paul Kühne hace 9 años
padre
commit
9221ad0ce1
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      Sources/VLCAlertView.m

+ 10 - 2
Sources/VLCAlertView.m

@@ -2,7 +2,7 @@
  * VLCStatusLabel.m
  * VLC for iOS
  *****************************************************************************
- * Copyright (c) 2014 VideoLAN. All rights reserved.
+ * Copyright (c) 2014-2015 VideoLAN. All rights reserved.
  * $Id$
  *
  * Authors: Carola Nitz <nitz.carola # googlemail.com>
@@ -45,11 +45,19 @@
 }
 
 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
-
     if (self.completion) {
         self.completion(buttonIndex == self.cancelButtonIndex, buttonIndex);
         self.completion = nil;
+        self.delegate = nil;
     }
 }
 
+- (void)show
+{
+    if (self.completion)
+        self.delegate = self;
+
+    [super show];
+}
+
 @end