I have just added an ADBannerview in my App. I create the AdBannerView in my UIApplicationDelegate in order to have only one instance of it and I share it in the different viewController
Everything works perfectly except I get the warning message: ADBannerView: WARNING A banner view (0x9c75550) has an ad but may be obscured. This message is only printed once per banner view.
when I open a modal view (using presentModalViewController) on top of the view that is currently displaying the ADBannerview. Before opening the modal view I'm using the following code to hide the ADBannerview:
- (void)viewWillDisappear:(BOOL)animated
{
ADBannerView *bannerView = [ (ScoreBoardAppDelegate*)[[UIApplication sharedApplication] delegate] adBanner];
[self hideBanner:bannerView];
[super viewWillDisappear:animated];
}
- (void)hideBanner:(ADBannerView*) adBanner {
NSLog(@"%s called", __FUNCTION__);
// Grow the tableview to occupy space left by banner, it's the size of the parent view
CGFloat fullViewHeight = self.tbView.frame.size.height;
CGRect tableFrame = self.tv.frame;
tableFrame.size.height = fullViewHeight;
// Move the banner view offscreen
CGRect bannerFrame = adBanner.frame;
CGRect screenBounds = [[UIScreen mainScreen] bounds];
bannerFrame.origin = CGPointMake(CGRectGetMinX(screenBounds), CGRectGetMaxY(screenBounds));
self.tv.frame = tableFrame;
adBanner.frame = bannerFrame;
}
I don't understand what to do to not have this warning message. It seems the ADBannerView is successfully hidden (offscreen) before the Modal view is displayed.
I probably missed something but I cannot see it. Thanks for your help,
Sébastien.