无法解雇UIAlertController

时间:2016-05-30 05:59:22

标签: ios objective-c uialertcontroller

如果网络不可用,那么它显示“网络不可用”的警告但在此之后加载微调器无法解除...它不断显示加载微调器......

-(void)viewDidAppear:(BOOL)animated{
   [super viewDidAppear:animated];
   [self showSpinner];
   [self getDashBoard];
}

- (void) getDashBoard {
       //[API call]
       // if success then
              //assign values from response 
              [self dismissSpinner]
       // else 
       //     [self dismissSpinner]
       //     [Utility displayAlert:@"Error" WithMessage:@"Network not available"];

  }



 #pragma mark - LodingSpinner
 - (void) showSpinner {
     if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
    // use UIAlertView
}
else {
    lodingSpinner = [Utility showProgress];
    [self.parentViewController presentViewController:lodingSpinner animated:NO completion:nil];
     }
}

- (void) dismissSpinner {
      if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
    // use UIAlertView
     }
     else {
         [lodingSpinner dismissViewControllerAnimated:YES completion:nil];
     }
 }

0 个答案:

没有答案