help with iAds

Discussion in 'iOS Programming' started by cinek, Apr 29, 2011.

  1. cinek, Apr 29, 2011
    Last edited: Apr 29, 2011

    macrumors 6502

    Mar 12, 2011
    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:

    @synthesize bannerIsVisible;
    -(void)bannerViewDidLoadAd:(ADBannerView *)banner {
            [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
            banner.frame = CGRectOffset(banner.frame, 0, 280);
            [UIView commitAnimations];
            self.bannerIsVisible = YES;
    -(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
            [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;
  2. macrumors regular

    Aug 26, 2010
    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.

Share This Page