Search code examples
iphoneiosios6iadadbannerview

iOS 6 iAd strange warning


I have implemented iAd in my iPhone application. I am using storyboard and have two viewControllers. I have implemented an AdBannerView in both viewControllers and have set the delegate to self. I have imported the and implemented the AdBanner delegate . I have also implemented the two methods -(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error and -(void)bannerViewDidLoadAd:(ADBannerView *)banner which hides and shows the adView depending on if there are any ads available. But when I run the app and switches back and forth between the two viewControllers about 10 times I get this printed in logger in Xcode. I also set the adView = nil in the -(void)viewDidDisappear:(BOOL)animated method

WARNING: More than 10 instances of ADBannerView or ADInterstitialView currently exist. This is a misuse of the iAd API, and ad performance will suffer as a result. This message is printed only once.

What does this mean? Have I done something wrong when I implemented iAd? Does this mean my app will be rejected by Apple?

SOLVED:

[adView removeFromSuperview]; in the -(void)viewDidDisappear:(BOOL)animated method did it!


Solution

  • try this, I think your problem solve

    - (void) viewWillDisappear:(BOOL)animated 
    {
    [_adView removeFromSuperview];
    _adView.delegate = nil;
    _adView = nil;
    }