4

I have a tab-view based iOS app, and I want to use AdMob GADInterstitial.

        if (gadFullReady) { //this check if GAD interstitial received ad
            NSLog(@"from GAD");
            [gadFull presentFromRootViewController:self];
        }

No AdMob interstitial shows up, and I got error message like:

        Warning: Attempt to present <GADWebAppViewController: 0x9965bd0> on <UITabBarController: 0xb24ab00> while a presentation is in progress!

Seems my current view controller is presenting something, so I go check whatever it is and dismiss it.

            NSLog(@"above view %@", [[self presentedViewController] description]);
            UIViewController *currVC = [self presentedViewController];
            [currVC dismissViewControllerAnimated:NO completion:^(){
                [gadFull presentFromRootViewController:self];
            }];

And this time I got error message:

       above view <UINavigationController: 0x99cbbe0>
       Warning: Attempt to dismiss from view controller <UITabBarController: 0x9992890> while a presentation or dismiss is in progress!

anybody knows why? TIA!

Tony Xu
  • 3,031
  • 4
  • 32
  • 43

1 Answers1

0
- (void)viewDidLoad
{
    [super viewDidLoad];
    _iSel=0;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) self.tableView.tintColor = kIHLightColor;
    [self.tableView setContentOffset:CGPointMake(0, -20)];
    [self.tableView setContentInset:UIEdgeInsetsMake(20, 0, 0, 0)];

    self.tableView.backgroundColor = kIHMenuCellBackgroundColor;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:_iSel inSection:0]
                                animated:NO
                          scrollPosition:UITableViewScrollPositionNone];
}

save the select value

Gank
  • 4,507
  • 4
  • 49
  • 45