Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cinek

macrumors 6502
Original poster
I'm trying to implement iAds in my first app. But I'm getting this error message: ADBannerView: WARNING A banner view (0x620a390) has an ad but may be obscured. This message is only printed once per banner view.



the ad shows up for about a second or so, and dissapears. I have no idea what's wrong. I need it to display at the bottom of the screen. I have imported the framework & the iAd/iAd.h file in the header file. Here's the code I'm using:

Code:
@synthesize bannerIsVisible;

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {

    if(!self.bannerIsVisible){

        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];

        banner.frame = CGRectOffset(banner.frame, 0, 280);

        [UIView commitAnimations];

        self.bannerIsVisible = YES;

    }

}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {

    if(self.bannerIsVisible){

        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];

        //banner is visible - move it out of the screen due to a connection issue

        banner.frame = CGRectOffset(banner.frame, 0, -280);

        [UIView commitAnimations];

        self.bannerIsVisible = NO;

    }

}

//from view did load
    banner = [[ADBannerView alloc] initWithFrame:CGRectZero];

     banner.frame = CGRectOffset(adView.frame, 0, -280);

     banner.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];

    banner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;

    [self.view addSubview:banner];

    banner.delegate = self;

    self.bannerIsVisible = NO;
 
Last edited:
I'm trying to implement iAds in my first app. But I'm getting this error message: ADBannerView: WARNING A banner view (0x620a390) has an ad but may be obscured. This message is only printed once per banner view.



the ad shows up for about a second or so, and dissapears. I have no idea what's wrong. I need it to display at the bottom of the screen. I have imported the framework & the iAd/iAd.h file in the header file. Here's the code I'm using:

Code:
@synthesize bannerIsVisible;

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {

    if(!self.bannerIsVisible){

        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];

        banner.frame = CGRectOffset(banner.frame, 0, 280);

        [UIView commitAnimations];

        self.bannerIsVisible = YES;

    }

}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {

    if(self.bannerIsVisible){

        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];

        //banner is visible - move it out of the screen due to a connection issue

        banner.frame = CGRectOffset(banner.frame, 0, -280);

        [UIView commitAnimations];

        self.bannerIsVisible = NO;

    }

}

//from view did load
    banner = [[ADBannerView alloc] initWithFrame:CGRectZero];

     banner.frame = CGRectOffset(adView.frame, 0, -280);

     banner.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];

    banner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;

    [self.view addSubview:banner];

    banner.delegate = self;

    self.bannerIsVisible = NO;

Take a look at the sample code for iAds. Sorry I don't have the link handy. It sounds like your not adjusting your other views properly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.