Error hidding iAdBanner when fails and trying to show my own button Xcode iOS7

| | August 11, 2015

Hi I’m trying to hide the iAdBanner when it fails and I want to show my own button with my other URL itunes app, but it doesn’t work on iOS 7. Can someone help me? thank you!

(The iAd banner works properly).

My code is:

- (void)viewDidLoad {
    [super viewDidLoad];
    _myBanner.hidden = TRUE;
    _myBanner.enabled = FALSE;
}

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [banner setAlpha:1];
    [UIView commitAnimations];
}

- (void)bannerView:(ADBannerView *) banner didFailToReceiveAdWithError:(NSError *)error
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [banner setAlpha:0];
    [UIView commitAnimations];

    if (_adBannerViewIsVisible) {

         _adBannerViewIsVisible = NO;
         [self fixupAdView:[UIDevice currentDevice].orientation]; /*This doesn't work*/
    }

    _myBanner.hidden = FALSE;
    _myBanner.enabled = TRUE;

    [ADBannerView removeFromSuperview]; /*This doesn't work*/ 
    [ADBannerView release]; /*This doesn't work*/

}

- (IBAction)tapBanner:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];
}

One Response to “Error hidding iAdBanner when fails and trying to show my own button Xcode iOS7”

  1. Ghanshyam Tomar on November 30, -0001 @ 12:00 AM
         - (void)bannerView:(ADBannerView *) banner didFailToReceiveAdWithError:(NSError *)error
                {     
                [UIView beginAnimations:nil context:NULL];
                [UIView setAnimationDuration:1];
                [banner setAlpha:0];
                [UIView commitAnimations];   _myBanner.hidden = YES;
    
                        _myBanner.enabled = NO;
                        [_myBanner removeFromSuperview]; 
                        [_myBanner release]; 
    }
    

Leave a Reply